public class LongType extends NumberType<java.lang.Long>
AbstractType.ComparisonTypeAssignmentTestable.TestResult| Modifier and Type | Field and Description |
|---|---|
static LongType |
instance |
comparatorSet, 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() |
<VL,VR> int |
compareCustom(VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR)
Implement IFF ComparisonType is CUSTOM
Compares the byte 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
|
static <VL,VR> int |
compareLongs(VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR) |
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.Long> |
getSerializer() |
boolean |
isEmptyValueMeaningless()
|
boolean |
isValueCompatibleWithInternal(AbstractType<?> otherType)
Needed to handle ReversedType in value-compatibility checks.
|
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 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.
|
isFloatingPoint, toBigDecimal, toBigInteger, toByte, toDouble, toShortasCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareForCQL, compose, compose, decompose, expandUserTypes, freeze, freezeNestedMulticellTypes, getComponents, getString, getString, getString, isCollection, isCompatibleWith, isCounter, isFreezable, isFrozenCollection, isMultiCell, isReversed, isTuple, isUDT, isValueCompatibleWith, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toJSONString, toString, toString, validate, validate, validateCellValue, validateCollectionMember, withUpdatedUserType, writeValue, writeValue, writtenLength, writtenLengthpublic static final LongType instance
public boolean isEmptyValueMeaningless()
AbstractTypeisEmptyValueMeaningless in class AbstractType<java.lang.Long>public <VL,VR> int compareCustom(VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR)
AbstractTypecompareCustom in class AbstractType<java.lang.Long>public static <VL,VR> int compareLongs(VL left,
ValueAccessor<VL> accessorL,
VR right,
ValueAccessor<VR> accessorR)
public java.nio.ByteBuffer fromString(java.lang.String source)
throws MarshalException
AbstractTypefromString in class AbstractType<java.lang.Long>MarshalExceptionpublic Term fromJSONObject(java.lang.Object parsed) throws MarshalException
AbstractTypefromJSONObject in class AbstractType<java.lang.Long>parsed - the result of parsing a json stringMarshalExceptionpublic java.lang.String toJSONString(java.nio.ByteBuffer buffer,
ProtocolVersion protocolVersion)
AbstractTypeThe buffer position will stay the same.
toJSONString in class AbstractType<java.lang.Long>buffer - the value to convertprotocolVersion - the protocol version to use for the conversionpublic boolean isValueCompatibleWithInternal(AbstractType<?> otherType)
AbstractTypeisValueCompatibleWithInternal in class AbstractType<java.lang.Long>public CQL3Type asCQL3Type()
asCQL3Type in class AbstractType<java.lang.Long>public TypeSerializer<java.lang.Long> getSerializer()
getSerializer in class AbstractType<java.lang.Long>public int valueLengthIfFixed()
AbstractTypevalueLengthIfFixed in class AbstractType<java.lang.Long>protected int toInt(java.nio.ByteBuffer value)
NumberTypeint if allowed.toInt in class NumberType<java.lang.Long>value - the value to convertprotected float toFloat(java.nio.ByteBuffer value)
NumberTypefloat if allowed.toFloat in class NumberType<java.lang.Long>value - the value to convertprotected long toLong(java.nio.ByteBuffer value)
NumberTypelong if allowed.toLong in class NumberType<java.lang.Long>value - the value to convertpublic java.nio.ByteBuffer add(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
NumberTypeadd in class NumberType<java.lang.Long>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)
NumberTypesubstract in class NumberType<java.lang.Long>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)
NumberTypemultiply in class NumberType<java.lang.Long>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)
NumberTypedivide in class NumberType<java.lang.Long>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)
NumberTypemod in class NumberType<java.lang.Long>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)
NumberTypenegate in class NumberType<java.lang.Long>input - the argument to negateCopyright © 2009-2022 The Apache Software Foundation