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, waitgetType, isZeroisNullpublic 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)
DataTokenTokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataTokens in Maps.public int hashCode()
DataTokenTokenConverter.asHashCode(TokenValued).public final ObjectTokenType<O> getType()
TokenValuedgetType in interface ObjectValued<O>getType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ObjectTyped<O>getType in interface ScalarTypedgetType in interface TokenTypedpublic final O asObject()
ObjectValuedasObject in interface ObjectValued<O>TokenValued.isNull(), null is returned.public 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.