public final class DoubleRegister extends Object implements ScalarRegister, DoubleSettable
DoubleValued
object.MAX_INFINITY, MIN_INFINITY
Constructor and Description |
---|
DoubleRegister()
Creates a new null-valued register.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
asBigDecimal()
Gets the contained numeric value.
|
double |
asDouble()
Gets the contained double value.
|
ScalarTokenType |
getType()
Gets the data type of the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
boolean |
isZero()
Indicates whether the value is the zero value
for the type.
|
void |
set(double value)
Sets the container to the given double value.
|
void |
set(float value)
Sets the container to the given float value.
|
void |
set(int value)
Sets the container to the given integer value.
|
void |
set(long value)
Sets the container to the given long value.
|
void |
set(TokenValued value)
Sets the contained value to the given token value.
|
void |
setNull()
Sets the contained value to be null valued.
|
void |
setZero()
Sets the contained value to be zero valued.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getType, isZero
isNull
public void setNull()
TokenSettable
setNull
in interface TokenSettable
public void setZero()
TokenSettable
setZero
in interface TokenSettable
public void set(int value)
IntSettable
set
in interface IntSettable
value
- integer value to which to set the containerpublic void set(long value)
LongSettable
set
in interface LongSettable
value
- long value to which to set the containerpublic void set(float value)
FloatSettable
set
in interface FloatSettable
value
- float value to which to set the containerpublic void set(double value)
DoubleSettable
set
in interface DoubleSettable
value
- double value to which to set the containerpublic void set(TokenValued value)
TokenSettable
set
in interface TokenSettable
value
- the value to which to set the containerpublic 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 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 © 2020 Actian Corporation. All rights reserved.