O
- the type of Java object contained in the tokenpublic final class ObjectToken<O> extends Object implements ScalarToken, Comparable<ObjectToken<O>>
ObjectValued
object.Constructor and Description |
---|
ObjectToken(O value)
Constructs a new token with the given non-null
object.
|
ObjectToken(ObjectTokenType<O> type,
O value)
Creates an object token
|
ObjectToken(ObjectValued<O> value)
Constructs a new token with the object
value in the given container.
|
Modifier and Type | Method and Description |
---|---|
O |
asObject()
Gets the contained Java object.
|
int |
compareTo(ObjectToken<O> that) |
boolean |
equals(Object obj)
Indicates whether another object is equal to this token.
|
ObjectTokenType<O> |
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 <O> ObjectToken<O> |
NULL(Class<O> type)
Gets a null valued
ObjectToken of the specified type. |
static <O> ObjectToken<O> |
NULL(ObjectTokenType<O> type)
Gets a null valued
ObjectToken of the specified type. |
String |
toString() |
static <O> ObjectToken<O> |
ZERO(ObjectTokenType<O> type)
Gets a zero valued
ObjectToken of the specified type. |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getType, isZero
isNull
public ObjectToken(ObjectValued<O> value)
value
- a ObjectValued
containing the
desired valuepublic ObjectToken(ObjectTokenType<O> type, O value)
type
- the static type of the object tokenvalue
- the value of the tokenpublic ObjectToken(O value)
NULL(Class)
.value
- the object value of the tokenNullPointerException
- if the value is null
.public static <O> ObjectToken<O> NULL(ObjectTokenType<O> type)
ObjectToken
of the specified type.O
- the type of Java object contained in the tokentype
- the TokenType
object describing the Java typepublic static <O> ObjectToken<O> ZERO(ObjectTokenType<O> type)
ObjectToken
of the specified type.O
- the type of Java object contained in the tokentype
- the TokenType
object describing the Java typepublic static <O> ObjectToken<O> NULL(Class<O> type)
ObjectToken
of the specified type.O
- the type of Java object contained in the tokentype
- the Class
object describing the Java typepublic int compareTo(ObjectToken<O> that)
compareTo
in interface Comparable<ObjectToken<O>>
public boolean equals(Object obj)
DataToken
TokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataToken
s in Map
s.public int hashCode()
DataToken
TokenConverter.asHashCode(TokenValued)
.public 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.