public final class DurationRegister extends Object implements ScalarRegister, DurationSettable
DurationValued
object.Constructor and Description |
---|
DurationRegister()
Creates a new null-valued register.
|
Modifier and Type | Method and Description |
---|---|
Duration |
asDuration()
Gets the contained Duration value as a
java.time.Duration . |
long |
asSeconds()
Get the contained duration value as the number of seconds.
|
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(Duration value)
Sets the container to a duration value specified as a
java.time.Duration object. |
void |
set(long seconds,
int nanos)
Sets the container to a directed duration value specified as
seconds and nanoseconds.
|
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.
|
int |
subsecNanos()
Get the subsecond portion of the contained duration value.
|
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(long seconds, int nanos)
DurationSettable
set
in interface DurationSettable
seconds
- number of seconds in durationnanos
- fractional nanosecond portion of durationpublic void set(Duration value)
DurationSettable
java.time.Duration
object.set
in interface DurationSettable
value
- duration 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 long asSeconds()
DurationValued
asSeconds
in interface DurationValued
TokenValued.isNull()
,
0
is returned.DurationValued.subsecNanos()
public int subsecNanos()
DurationValued
subsecNanos
in interface DurationValued
TokenValued.isNull()
,
0
is returned.DurationValued.asSeconds()
public final Duration asDuration()
DurationValued
java.time.Duration
.asDuration
in interface DurationValued
java.time.Duration
. If null valued,
as indicated by TokenValued.isNull()
, null
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 © 2021 Actian Corporation. All rights reserved.