public final class StringToken extends Object implements ScalarToken, Comparable<StringToken>
StringValued object.| Modifier and Type | Field and Description |
|---|---|
static StringToken |
NULL
A null valued
StringToken |
static StringToken |
ZERO
A zero valued
StringToken |
static String |
ZERO_VALUE
The string representing a zero value, the empty string.
|
| Constructor and Description |
|---|
StringToken(String value)
Constructs an new token with the given non-null
string.
|
StringToken(StringValued value)
Constructs a new token with the string
value in the given container.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asString()
Gets the contained string value.
|
int |
compareTo(StringToken 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 StringToken |
parse(String value)
Converts a string into a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetType, isZeroisNullpublic static final StringToken NULL
StringTokenpublic static final String ZERO_VALUE
public static final StringToken ZERO
StringTokenpublic StringToken(StringValued value)
value - a StringValued containing the
desired valuepublic StringToken(String value)
NULL.value - the string value of the tokenNullPointerException - if the value is null.public int compareTo(StringToken that)
compareTo in interface Comparable<StringToken>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 StringToken parse(String value)
value - the string value of the tokenpublic ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final String asString()
StringValuedasString in interface StringValuedString.
If null valued, as indicated by TokenValued.isNull(), the empty
string ("") 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.