public class DoubleType extends NumberType<java.lang.Double>
AbstractType.ComparisonType
AssignmentTestable.TestResult
Modifier and Type | Field and Description |
---|---|
static DoubleType |
instance |
comparisonType, isByteOrderComparable, reverseComparator
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
add(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Adds the left argument to the right one.
|
CQL3Type |
asCQL3Type() |
int |
compareCustom(java.nio.ByteBuffer o1,
java.nio.ByteBuffer o2)
Implement IFF ComparisonType is CUSTOM
Compares the ByteBuffer representation of two instances of this class,
for types where this cannot be done by simple in-order comparison of the
unsigned bytes
Standard Java compare semantics
|
java.nio.ByteBuffer |
divide(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Divides the left argument by the right one.
|
Term |
fromJSONObject(java.lang.Object parsed)
Given a parsed JSON string, return a byte representation of the object.
|
java.nio.ByteBuffer |
fromString(java.lang.String source)
get a byte representation of the given string.
|
TypeSerializer<java.lang.Double> |
getSerializer() |
boolean |
isEmptyValueMeaningless()
|
boolean |
isFloatingPoint()
Checks if this type support floating point numbers.
|
java.nio.ByteBuffer |
mod(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Return the remainder.
|
java.nio.ByteBuffer |
multiply(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Multiplies the left argument with the right one.
|
java.nio.ByteBuffer |
negate(java.nio.ByteBuffer input)
Negates the argument.
|
java.nio.ByteBuffer |
substract(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Substracts the left argument from the right one.
|
protected double |
toDouble(java.nio.ByteBuffer value)
Converts the specified value into a
double if allowed. |
protected float |
toFloat(java.nio.ByteBuffer value)
Converts the specified value into a
float if allowed. |
protected int |
toInt(java.nio.ByteBuffer value)
Converts the specified value into an
int if allowed. |
java.lang.String |
toJSONString(java.nio.ByteBuffer buffer,
ProtocolVersion protocolVersion)
Converts the specified value into its JSON representation.
|
protected long |
toLong(java.nio.ByteBuffer value)
Converts the specified value into a
long if allowed. |
int |
valueLengthIfFixed()
The length of values for this type if all values are of fixed length, -1 otherwise.
|
toBigDecimal, toBigInteger, toByte, toShort
asCQLTypeStringList, checkComparable, compare, compareCollectionMembers, compareForCQL, componentsCount, compose, decompose, expandUserTypes, freeze, freezeNestedMulticellTypes, getComponents, getString, getString, isCollection, isCompatibleWith, isCounter, isFreezable, isFrozenCollection, isMultiCell, isReversed, isTuple, isUDT, isValueCompatibleWith, isValueCompatibleWithInternal, parseDefaultParameters, readValue, readValue, referencesDuration, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toString, toString, validate, validateCellValue, validateCollectionMember, withUpdatedUserType, writeValue, writtenLength
public static final DoubleType instance
public boolean isEmptyValueMeaningless()
AbstractType
isEmptyValueMeaningless
in class AbstractType<java.lang.Double>
public boolean isFloatingPoint()
NumberType
isFloatingPoint
in class NumberType<java.lang.Double>
true
if this type support floating point numbers, false
otherwise.public int compareCustom(java.nio.ByteBuffer o1, java.nio.ByteBuffer o2)
AbstractType
compareCustom
in class AbstractType<java.lang.Double>
public java.nio.ByteBuffer fromString(java.lang.String source) throws MarshalException
AbstractType
fromString
in class AbstractType<java.lang.Double>
MarshalException
public Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractType
fromJSONObject
in class AbstractType<java.lang.Double>
parsed
- the result of parsing a json stringMarshalException
public java.lang.String toJSONString(java.nio.ByteBuffer buffer, ProtocolVersion protocolVersion)
AbstractType
The buffer position will stay the same.
toJSONString
in class AbstractType<java.lang.Double>
buffer
- the value to convertprotocolVersion
- the protocol version to use for the conversionpublic CQL3Type asCQL3Type()
asCQL3Type
in class AbstractType<java.lang.Double>
public TypeSerializer<java.lang.Double> getSerializer()
getSerializer
in class AbstractType<java.lang.Double>
public int valueLengthIfFixed()
AbstractType
valueLengthIfFixed
in class AbstractType<java.lang.Double>
protected int toInt(java.nio.ByteBuffer value)
NumberType
int
if allowed.toInt
in class NumberType<java.lang.Double>
value
- the value to convertprotected float toFloat(java.nio.ByteBuffer value)
NumberType
float
if allowed.toFloat
in class NumberType<java.lang.Double>
value
- the value to convertprotected long toLong(java.nio.ByteBuffer value)
NumberType
long
if allowed.toLong
in class NumberType<java.lang.Double>
value
- the value to convertprotected double toDouble(java.nio.ByteBuffer value)
NumberType
double
if allowed.toDouble
in class NumberType<java.lang.Double>
value
- the value to convertpublic java.nio.ByteBuffer add(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberType
add
in class NumberType<java.lang.Double>
leftType
- the type associated to the left argumentleft
- the left argumentrightType
- the type associated to the right argumentright
- the right argumentpublic java.nio.ByteBuffer substract(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberType
substract
in class NumberType<java.lang.Double>
leftType
- the type associated to the left argumentleft
- the left argumentrightType
- the type associated to the right argumentright
- the right argumentpublic java.nio.ByteBuffer multiply(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberType
multiply
in class NumberType<java.lang.Double>
leftType
- the type associated to the left argumentleft
- the left argumentrightType
- the type associated to the right argumentright
- the right argumentpublic java.nio.ByteBuffer divide(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberType
divide
in class NumberType<java.lang.Double>
leftType
- the type associated to the left argumentleft
- the left argumentrightType
- the type associated to the right argumentright
- the right argumentpublic java.nio.ByteBuffer mod(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberType
mod
in class NumberType<java.lang.Double>
leftType
- the type associated to the left argumentleft
- the left argumentrightType
- the type associated to the right argumentright
- the right argumentpublic java.nio.ByteBuffer negate(java.nio.ByteBuffer input)
NumberType
negate
in class NumberType<java.lang.Double>
input
- the argument to negateCopyright © 2009-2020 The Apache Software Foundation