public final class CharToken extends Object implements ScalarToken, Comparable<CharToken>
CharValued object.| Modifier and Type | Field and Description |
|---|---|
static CharToken |
NULL
A null valued
CharToken |
static CharToken |
ZERO
A zero valued
CharToken |
static char |
ZERO_VALUE
The character representing a zero value,
'\0'. |
| Constructor and Description |
|---|
CharToken(char value)
Constructs a new token with the given non-null
character value.
|
CharToken(CharValued value)
Constructs a new token with the character
value in the given container.
|
| Modifier and Type | Method and Description |
|---|---|
char |
asChar()
Gets the contained character value.
|
Character |
asObject()
Gets the value of the token as an object.
|
int |
compareTo(CharToken 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 CharToken |
parse(String value)
Converts a string representation of a char value into
a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetType, isZeroisNullpublic static final CharToken NULL
CharTokenpublic static final char ZERO_VALUE
'\0'.public static final CharToken ZERO
CharTokenpublic CharToken(CharValued value)
value - a CharValued containing the
desired valuepublic CharToken(char value)
NULL.value - the character value of the tokenpublic int compareTo(CharToken that)
compareTo in interface Comparable<CharToken>public Character asObject()
null if the token is null valued.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 static CharToken parse(String value)
value - a string value to interpret as a character;
this must be exactly 1 character in lengthpublic final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final char asChar()
CharValuedasChar in interface CharValuedchar. If null valued,
as indicated by TokenValued.isNull(), Character.MAX_VALUE
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 © 2016 Actian Corporation. All rights reserved.