public final class BooleanToken extends Object implements ScalarToken, Comparable<BooleanToken>
BooleanValued object.| Modifier and Type | Field and Description |
|---|---|
static BooleanToken |
FALSE
A
BooleanToken with a value of false |
static BooleanToken |
NULL
A null valued
BooleanToken |
static BooleanToken |
TRUE
A
BooleanToken with a value of true |
static BooleanToken |
ZERO
A zero valued
BooleanToken |
static boolean |
ZERO_VALUE
The boolean representing a zero value,
false. |
| Constructor and Description |
|---|
BooleanToken(boolean value)
Constructs a new token with the given non-null
boolean value.
|
BooleanToken(BooleanValued value)
Constructs a new token with the boolean
value in the given container.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Gets the contained boolean value.
|
Boolean |
asObject()
Gets the value of the token as an object.
|
int |
compareTo(BooleanToken that) |
boolean |
equals(Object obj)
Indicates whether another object is equal to this token.
|
static BooleanToken |
getToken(boolean value)
Returns a token with the given non-null value boolean value.
|
static BooleanToken |
getToken(BooleanValued value)
Returns a token with the boolean value in the given container.
|
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 BooleanToken |
parse(String value)
Converts a string representation of a boolean value into
a token.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetType, isZeroisNullpublic static final BooleanToken NULL
BooleanTokenpublic static final BooleanToken TRUE
BooleanToken with a value of truepublic static final BooleanToken FALSE
BooleanToken with a value of falsepublic static final boolean ZERO_VALUE
false.public static final BooleanToken ZERO
BooleanTokenpublic BooleanToken(BooleanValued value)
It is generally preferable to use getToken(BooleanValued)
instead.
value - a BooleanValued containing the
desired valuepublic BooleanToken(boolean value)
NULL.
It is generally preferable to use getToken(boolean)
instead.
value - the boolean value of the tokenpublic static BooleanToken getToken(BooleanValued value)
value - a BooleanValued containing the
desired valuepublic static BooleanToken getToken(boolean value)
value - the boolean value of the tokenpublic Boolean asObject()
null if the token is null valued.public int compareTo(BooleanToken that)
compareTo in interface Comparable<BooleanToken>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 BooleanToken parse(String value)
value - a string value to interpret as a boolean;
see Boolean.valueOf(String).public final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public final boolean asBoolean()
BooleanValuedasBoolean in interface BooleanValuedboolean. If null valued,
as indicated by TokenValued.isNull(), false is returned.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2020 Actian Corporation. All rights reserved.