public class NullToken extends Object implements ScalarToken, Comparable<NullToken>, BinaryValued, BooleanValued, CharValued, DateValued, IntValued, StringValued, TimeValued, TimestampValued
| Modifier and Type | Field and Description |
|---|---|
static NullToken |
NULL
A null valued
NullToken |
MAX_INFINITY, MIN_INFINITY| Modifier | Constructor and Description |
|---|---|
protected |
NullToken() |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
asBigDecimal()
Gets the contained numeric value.
|
byte[] |
asBinary()
Gets the contained binary value.
|
byte[] |
asBinaryRef()
Gets a reference to the contained binary value.
|
boolean |
asBoolean()
Gets the contained boolean value.
|
CalendarDate |
asCalendarDate()
Gets the contained date value.
|
char |
asChar()
Gets the contained character value.
|
Date |
asDate()
Gets the contained date value as a
java.sql.Date
relative to the default time zone. |
Date |
asDate(TimeZone tz)
Gets the contained date value as a
java.sql.Date
relative to the given time zone. |
int |
asDayMillis()
Gets the contained time value as the number of milliseconds
elapsed since midnight.
|
double |
asDouble()
Gets the contained double value.
|
long |
asEpochDays()
Gets the contained date value as the number of days since
Java epoch (January 1, 1970).
|
long |
asEpochSecs()
Gets the contained timestamp value as the number of seconds since
Java epoch (January 1, 1970 00:00:00 GMT).
|
float |
asFloat()
Gets the contained float value.
|
int |
asInt()
Gets the contained integer value.
|
long |
asLong()
Gets the contained long value.
|
String |
asString()
Gets the contained string value.
|
TimeOfDay |
asTimeOfDay()
Gets the contained time value.
|
Timestamp |
asTimestamp()
Gets the contained timestamp value as a
java.sql.Timestamp
relative to the default time zone. |
int |
compareTo(NullToken o) |
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.
|
int |
offsetSecs()
Gets the time zone and daylight saving time offset of the contained
timestamp value, in seconds.
|
int |
subsecNanos()
Gets the subsecond portion of the contained timestamp value.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisNullpublic static final NullToken NULL
NullTokenpublic int compareTo(NullToken o)
compareTo in interface Comparable<NullToken>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 ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public double asDouble()
DoubleValuedasDouble in interface DoubleValueddouble. If null valued,
as indicated by TokenValued.isNull(), Double.NaN
is returned.public BigDecimal asBigDecimal()
NumericValuedasBigDecimal in interface NumericValuedjava.math.BigDecimal.
If null valued, as indicated by TokenValued.isNull(), null
is returned.public long asLong()
LongValuedasLong in interface LongValuedlong. If null valued,
as indicated by TokenValued.isNull(), 0
is returned.public float asFloat()
FloatValuedasFloat in interface FloatValuedfloat. If null valued,
as indicated by TokenValued.isNull(), Float.NaN
is returned.public Timestamp asTimestamp()
TimestampValuedjava.sql.Timestamp
relative to the default time zone. The time zone used by
TimeZone#getDefault() is used.asTimestamp in interface TimestampValuedjava.sql.Timestamp.
If null valued, as indicated by TokenValued.isNull(),
null is returned.public long asEpochSecs()
TimestampValuedsubsecNanos()
in conjunction with this method.asEpochSecs in interface TimestampValuedTokenValued.isNull(),
0 is returned.TimestampValued.subsecNanos()public int subsecNanos()
TimestampValuedasEpochSecs(). Thus the value asEpochSecs()
* 1000000000 + subsecNanos() represents the number of
nanoseconds since Java epoch.subsecNanos in interface TimestampValuedTokenValued.isNull(),
0 is returned.TimestampValued.asEpochSecs()public int offsetSecs()
TimestampValuedoffsetSecs in interface TimestampValuedTokenValued.isNull(), 0 is returned.TimestampValued.asEpochSecs()public int asDayMillis()
TimeValuedasDayMillis in interface TimeValuedTokenValued.isNull(),
0 is returned.public TimeOfDay asTimeOfDay()
TimeValuedasTimeOfDay in interface TimeValuedTokenValued.isNull(),
null is returned.public String asString()
StringValuedasString in interface StringValuedString.
If null valued, as indicated by TokenValued.isNull(), the empty
string ("") is returned.public int asInt()
IntValuedasInt in interface IntValuedint. If null valued,
as indicated by TokenValued.isNull(), 0
is returned.public Date asDate()
DateValuedjava.sql.Date
relative to the default time zone. The time zone used by
TimeZone.getDefault() is used.asDate in interface DateValuedjava.sql.Date.
If null valued, as indicated by TokenValued.isNull(),
null is returned.public Date asDate(TimeZone tz)
DateValuedjava.sql.Date
relative to the given time zone.asDate in interface DateValuedtz - the time zone in which to interpret the datejava.sql.Date.
If null valued, as indicated by TokenValued.isNull(),
null is returned.public long asEpochDays()
DateValuedasEpochDays in interface DateValuedTokenValued.isNull(),
0 is returned.public CalendarDate asCalendarDate()
DateValuedasCalendarDate in interface DateValuedTokenValued.isNull(),
null is returned.public char asChar()
CharValuedasChar in interface CharValuedchar. If null valued,
as indicated by TokenValued.isNull(), Character.MAX_VALUE
is returned.public boolean asBoolean()
BooleanValuedasBoolean in interface BooleanValuedboolean. If null valued,
as indicated by TokenValued.isNull(), false is returned.public byte[] asBinary()
BinaryValued
The array returned is a copy of the binary data contained in
the object. To avoid this overhead, use BinaryValued.asBinaryRef()
instead.
asBinary in interface BinaryValuedbyte[]. If
null valued, as indicated by TokenValued.isNull(),
null is returned.public byte[] asBinaryRef()
BinaryValued
While this call avoids the overhead seen with BinaryValued.asBinary(),
the caller must guarantee that the returned array will not be
modified. Failure to comply may result in the dataflow exhibiting
unexpected behavior, as other operators may (or may not)
see the modified value.
asBinaryRef in interface BinaryValuedbyte[] holding the contained
value. If null valued, as indicated by TokenValued.isNull(),
null is returned.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2016 Actian Corporation. All rights reserved.