public final class FloatToken extends Object implements ScalarToken, Comparable<FloatToken>
FloatValued
object.Modifier and Type | Field and Description |
---|---|
static FloatToken |
NULL
A null valued
FloatToken |
static FloatToken |
ZERO
A zero valued
FloatToken |
static float |
ZERO_VALUE
The float zero value,
0.0 . |
MAX_INFINITY, MIN_INFINITY
Constructor and Description |
---|
FloatToken(float value)
Constructs a new token with the given non-null
float value.
|
FloatToken(FloatValued value)
Constructs a new token with the float
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.
|
Float |
asObject()
Gets the value of the token as an object.
|
int |
compareTo(FloatToken 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 FloatToken |
parse(String value)
Converts a string representation of a float value into
a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getType, isZero
isNull
public static final FloatToken NULL
FloatToken
public static final float ZERO_VALUE
0.0
.public static final FloatToken ZERO
FloatToken
public FloatToken(FloatValued value)
value
- a FloatValued
containing the
desired valuepublic FloatToken(float value)
NULL
.value
- the float value of the tokenpublic int compareTo(FloatToken that)
compareTo
in interface Comparable<FloatToken>
public boolean equals(Object obj)
DataToken
TokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataToken
s in Map
s.public Float asObject()
null
if the token is null valued.public int hashCode()
DataToken
TokenConverter.asHashCode(TokenValued)
.public static FloatToken parse(String value)
value
- a string value to interpret as a float;
see Float.valueOf(String)
public final ScalarTokenType getType()
TokenValued
getType
in interface ScalarValued
getType
in interface TokenValued
getType
in interface ScalarTyped
getType
in interface TokenTyped
public final BigDecimal asBigDecimal()
NumericValued
asBigDecimal
in interface NumericValued
java.math.BigDecimal
.
If null valued, as indicated by TokenValued.isNull()
, null
is returned.public final double asDouble()
DoubleValued
asDouble
in interface DoubleValued
double
. If null valued,
as indicated by TokenValued.isNull()
, Double.NaN
is returned.public final float asFloat()
FloatValued
asFloat
in interface FloatValued
float
. If null valued,
as indicated by TokenValued.isNull()
, Float.NaN
is returned.public final boolean isZero()
ScalarValued
isZero
in interface ScalarValued
true
if the value is the zero value,
false
otherwise.public final boolean isNull()
TokenValued
isNull
in interface TokenValued
true
if the token is null valued,
false
otherwiseCopyright © 2016 Actian Corporation. All rights reserved.