public final class LongToken extends Object implements ScalarToken, Comparable<LongToken>
LongValued object.| Modifier and Type | Field and Description |
|---|---|
static LongToken |
NULL
A null valued
LongToken |
static LongToken |
ZERO
A zero valued
LongToken |
static long |
ZERO_VALUE
The long zero value,
0L. |
MAX_INFINITY, MIN_INFINITY| Constructor and Description |
|---|
LongToken(long value)
Constructs a new token with the given non-null
long value.
|
LongToken(LongValued value)
Constructs a new token with the long
value in the given container.
|
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
asBigDecimal()
Gets the contained numeric value.
|
double |
asDouble()
Gets the contained double value.
|
float |
asFloat()
Gets the contained float value.
|
long |
asLong()
Gets the contained long value.
|
int |
compareTo(LongToken that) |
boolean |
equals(Object obj)
Indicates whether another object is equal to this token.
|
ScalarTokenType |
getType()
Gets the data type of the token.
|
int |
hashCode()
Returns a hash code for the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
boolean |
isZero()
Indicates whether the value is the zero value
for the type.
|
static LongToken |
parse(String value)
Converts a string representation of a long value into
a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetType, isZeroisNullpublic static final LongToken NULL
LongTokenpublic static final long ZERO_VALUE
0L.public static final LongToken ZERO
LongTokenpublic LongToken(LongValued value)
value - a LongValued containing the
desired valuepublic LongToken(long value)
NULL.value - the long value of the tokenpublic int compareTo(LongToken that)
compareTo in interface Comparable<LongToken>public boolean equals(Object obj)
DataTokenTokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataTokens in Maps.public int hashCode()
DataTokenTokenConverter.asHashCode(TokenValued).public static LongToken parse(String value)
value - a string value to interpret as a long;
see Long.valueOf(String)public final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final BigDecimal asBigDecimal()
NumericValuedasBigDecimal in interface NumericValuedjava.math.BigDecimal.
If null valued, as indicated by TokenValued.isNull(), null
is returned.public final double asDouble()
DoubleValuedasDouble in interface DoubleValueddouble. If null valued,
as indicated by TokenValued.isNull(), Double.NaN
is returned.public final float asFloat()
FloatValuedasFloat in interface FloatValuedfloat. If null valued,
as indicated by TokenValued.isNull(), Float.NaN
is returned.public final long asLong()
LongValuedasLong in interface LongValuedlong. If null valued,
as indicated by TokenValued.isNull(), 0
is returned.public final boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2021 Actian Corporation. All rights reserved.