O
- the type of Java object contained in the tokenpublic final class ObjectRegister<O> extends Object implements ScalarRegister, ObjectSettable<O>
ObjectValued
object.Constructor and Description |
---|
ObjectRegister(ObjectTokenType<O> type)
Creates a new null-valued register of the specified object type.
|
Modifier and Type | Method and Description |
---|---|
O |
asObject()
Gets the contained Java object.
|
ObjectTokenType<O> |
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(O value)
Sets the container to the given object 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
getType
public ObjectRegister(ObjectTokenType<O> type)
type
- the object type allowed as register valuespublic void setNull()
TokenSettable
setNull
in interface TokenSettable
public void setZero()
TokenSettable
setZero
in interface TokenSettable
public void set(O value)
ObjectSettable
The value is stored by reference. Therefore, the caller must guarantee that the provided object will not be modified subsequent to this call. Failure to comply may result in unexpected behavior.
set
in interface ObjectSettable<O>
value
- object 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 ObjectTokenType<O> getType()
TokenValued
getType
in interface ObjectValued<O>
getType
in interface ScalarValued
getType
in interface TokenValued
getType
in interface ObjectTyped<O>
getType
in interface ScalarTyped
getType
in interface TokenTyped
public final O asObject()
ObjectValued
asObject
in interface ObjectValued<O>
TokenValued.isNull()
, null
is returned.public 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.