public abstract class NumberType<T extends java.lang.Number> extends AbstractType<T>
AbstractType.ComparisonTypeAssignmentTestable.TestResultcomparatorSet, comparisonType, isByteOrderComparable, reverseComparator| Modifier | Constructor and Description |
|---|---|
protected |
NumberType(AbstractType.ComparisonType comparisonType) |
| Modifier and Type | Method and Description |
|---|---|
abstract java.nio.ByteBuffer |
add(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Adds the left argument to the right one.
|
abstract java.nio.ByteBuffer |
divide(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Divides the left argument by the right one.
|
boolean |
isFloatingPoint()
Checks if this type support floating point numbers.
|
abstract java.nio.ByteBuffer |
mod(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Return the remainder.
|
abstract java.nio.ByteBuffer |
multiply(NumberType<?> leftType,
java.nio.ByteBuffer left,
NumberType<?> rightType,
java.nio.ByteBuffer right)
Multiplies the left argument with the right one.
|
abstract java.nio.ByteBuffer |
negate(java.nio.ByteBuffer input)
Negates the argument.
|
abstract 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 java.math.BigDecimal |
toBigDecimal(java.nio.ByteBuffer value)
Converts the specified value into a
BigDecimal. |
protected java.math.BigInteger |
toBigInteger(java.nio.ByteBuffer value)
Converts the specified value into a
BigInteger if allowed. |
protected byte |
toByte(java.nio.ByteBuffer value)
Converts the specified value into a
byte if allowed. |
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. |
protected long |
toLong(java.nio.ByteBuffer value)
Converts the specified value into a
long if allowed. |
protected short |
toShort(java.nio.ByteBuffer value)
Converts the specified value into a
short if allowed. |
asCQL3Type, asCQLTypeStringList, checkComparable, compare, compare, compareCollectionMembers, compareCustom, compareForCQL, compose, compose, decompose, expandUserTypes, freeze, freezeNestedMulticellTypes, fromJSONObject, fromString, getComponents, getSerializer, getString, getString, getString, isCollection, isCompatibleWith, isCounter, isEmptyValueMeaningless, isFreezable, isFrozenCollection, isMultiCell, isReversed, isTuple, isUDT, isValueCompatibleWith, isValueCompatibleWithInternal, parseDefaultParameters, read, readArray, readBuffer, readBuffer, referencesDuration, referencesUserType, referencesUserType, skipValue, subTypes, testAssignment, testAssignment, toJSONString, toJSONString, toString, toString, validate, validate, validateCellValue, validateCollectionMember, valueLengthIfFixed, withUpdatedUserType, writeValue, writeValue, writtenLength, writtenLengthprotected NumberType(AbstractType.ComparisonType comparisonType)
public boolean isFloatingPoint()
true if this type support floating point numbers, false otherwise.protected java.math.BigInteger toBigInteger(java.nio.ByteBuffer value)
BigInteger if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected java.math.BigDecimal toBigDecimal(java.nio.ByteBuffer value)
BigDecimal.value - the value to convertprotected byte toByte(java.nio.ByteBuffer value)
byte if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected short toShort(java.nio.ByteBuffer value)
short if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected int toInt(java.nio.ByteBuffer value)
int if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected long toLong(java.nio.ByteBuffer value)
long if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected float toFloat(java.nio.ByteBuffer value)
float if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionprotected double toDouble(java.nio.ByteBuffer value)
double if allowed.value - the value to convertjava.lang.UnsupportedOperationException - if the value cannot be converted without losing precisionpublic abstract java.nio.ByteBuffer add(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
leftType - the type associated to the left argumentleft - the left argumentrightType - the type associated to the right argumentright - the right argumentpublic abstract java.nio.ByteBuffer substract(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
leftType - the type associated to the left argumentleft - the left argumentrightType - the type associated to the right argumentright - the right argumentpublic abstract java.nio.ByteBuffer multiply(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
leftType - the type associated to the left argumentleft - the left argumentrightType - the type associated to the right argumentright - the right argumentpublic abstract java.nio.ByteBuffer divide(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
leftType - the type associated to the left argumentleft - the left argumentrightType - the type associated to the right argumentright - the right argumentpublic abstract java.nio.ByteBuffer mod(NumberType<?> leftType, java.nio.ByteBuffer left, NumberType<?> rightType, java.nio.ByteBuffer right)
leftType - the type associated to the left argumentleft - the left argumentrightType - the type associated to the right argumentright - the right argumentpublic abstract java.nio.ByteBuffer negate(java.nio.ByteBuffer input)
input - the argument to negateCopyright © 2009-2020 The Apache Software Foundation