public final class TimeToken extends Object implements ScalarToken, Comparable<TimeToken>
TimeValued object.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DAY_OFFSET |
static int |
MIN_DAY_OFFSET |
static TimeToken |
NULL
A null valued
TimeToken |
static TimeToken |
ZERO
A zero valued
TimeToken |
static int |
ZERO_VALUE
The time representing a zero value, midnight.
|
| Constructor and Description |
|---|
TimeToken(int dayMillis)
Constructs a new token with the non-null time value
specified as the number of milliseconds since midnight.
|
TimeToken(int hourOfDay,
int minuteOfHour,
int secondOfMinute)
Constructs a new token with the non-null time of day.
|
TimeToken(int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int subsecMillis)
Constructs a new token with the non-null time of day.
|
TimeToken(TimeOfDay time)
Constructs a new token with the non-null time of day.
|
TimeToken(TimeValued value)
Constructs a new token with the time
value in the given container.
|
| Modifier and Type | Method and Description |
|---|---|
int |
asDayMillis()
Gets the contained time value as the number of milliseconds
elapsed since midnight.
|
TimeOfDay |
asTimeOfDay()
Gets the contained time value.
|
int |
compareTo(TimeToken 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 TimeToken |
parse(String value)
Converts a string representation of a time value into
a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetType, isZeroisNullpublic static final TimeToken NULL
TimeTokenpublic static final int ZERO_VALUE
public static final TimeToken ZERO
TimeTokenpublic static final int MIN_DAY_OFFSET
public static final int MAX_DAY_OFFSET
public TimeToken(TimeValued value)
value - a TimeValued containing the
desired valuepublic TimeToken(int dayMillis)
NULL.dayMillis - the time value of the token, expressed as the
number milliseconds elapsed since midnightpublic TimeToken(int hourOfDay,
int minuteOfHour,
int secondOfMinute)
NULL.hourOfDay - the hour portion of the time. Hours are expressed
in 24-hour format, ranging from 0 to 23.minuteOfHour - the minute portion of the timesecondOfMinute - the seconds portion of the timepublic TimeToken(int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int subsecMillis)
NULL.hourOfDay - the hour portion of the time. Hours are expressed
in 24-hour format, ranging from 0 to 23.minuteOfHour - the minute portion of the timesecondOfMinute - the seconds portion of the timesubsecMillis - the milliseconds portion of the timepublic boolean equals(Object obj)
DataTokenTokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataTokens in Maps.public int hashCode()
DataTokenTokenConverter.asHashCode(TokenValued).public int compareTo(TimeToken that)
compareTo in interface Comparable<TimeToken>public static TimeToken parse(String value)
value - a string value to interpret as a time;
this must be in ISO8601 format.public final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final int asDayMillis()
TimeValuedasDayMillis in interface TimeValuedTokenValued.isNull(),
0 is returned.public final TimeOfDay asTimeOfDay()
TimeValuedasTimeOfDay in interface TimeValuedTokenValued.isNull(),
null 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.