O
- The underlying Java class of the tokens
represented by this type.public class ObjectTokenType<O> extends Object implements ScalarTokenType, ObjectTyped<O>
ObjectTokenType
represents these token types.
To define a token type for a given class, use
TokenTypeConstant#OBJECT(Class)
to obtain
an instance describing the type.
Note that while the built-in types do have corresponding
Java classes, these types are not equivalent to the
matching ObjectTokenType
. That is,
TokenTypeConstant#LONG
is not the same as
ObjectTokenType<Long>
.
Modifier and Type | Method and Description |
---|---|
void |
checkComparable(TokenType type)
Tests whether tokens of the specified type can be
compared to tokens of this type.
|
void |
dispatchByType(TokenTypeDispatcher dispatcher)
Dispatches processing to the type-appropriate method of the
specified dispatcher.
|
boolean |
equals(Object o) |
int |
getEncodedByteSize()
Gets the expected size, in bytes, for tokens of this
type.
|
String |
getExtendedType()
Returns the "extended type" of this object type.
|
Type[] |
getGenericParameters()
Returns the generic type parameters of this object type.
|
ParameterizedType |
getParameterizedType()
Returns the "parameterized type" of this object type which includes information about the generic parameter types.
|
Class<O> |
getTokenClass()
Returns the Java class of tokens having this token type.
|
ObjectTokenType<O> |
getType()
Gets the type of data tokens handled by the implementor.
|
int |
hashCode() |
boolean |
isAbstract()
Indicates whether this type is abstract.
|
boolean |
isAssignableFrom(TokenType source)
Indicates whether tokens of the specified type are
compatible or implicitly convertible to this type.
|
boolean |
isComparable()
Indicates whether the objects described by this token type are
Comparable . |
boolean |
isComposite()
Indicates whether this type is a composite type.
|
boolean |
isExtendedType()
Returns whether this represents an extended type.
|
boolean |
isGeneric()
Indicates whether this type is the generic type.
|
boolean |
isParameterizedType()
Returns whether this represents an parameterized type.
|
boolean |
isScalar()
Indicates whether this type is a scalar type.
|
String |
name()
Gets the printable name of this type.
|
String |
toString()
Describes the token type in a human-readable form.
|
public String name()
TokenType
public ObjectTokenType<O> getType()
TokenTyped
getType
in interface ObjectTyped<O>
getType
in interface ScalarTyped
getType
in interface TokenTyped
public String getExtendedType()
public boolean isExtendedType()
public Class<O> getTokenClass()
Class
object for the tokens described by this type.public boolean isComposite()
TokenType
isComposite
in interface TokenType
public boolean isGeneric()
TokenType
public boolean isScalar()
TokenType
public boolean isAbstract()
TokenType
isAbstract
in interface TokenType
public boolean isComparable()
Comparable
.
This is similar to checkComparable(TokenType)
, but
returns an answer instead of throwing an error.
true
if the underlying Java class implements
the Comparable
interface, false
otherwise.public Type[] getGenericParameters()
public ParameterizedType getParameterizedType()
public boolean isParameterizedType()
public boolean isAssignableFrom(TokenType source)
TokenType
isAssignableFrom
in interface TokenType
source
- the token type of the source datatrue
if the source type can be
converted.public void checkComparable(TokenType type)
TokenType
checkComparable
in interface TokenType
type
- the token type of data to comparepublic void dispatchByType(TokenTypeDispatcher dispatcher)
TokenType
TypeDispatchedConstructor
.dispatchByType
in interface TokenType
dispatcher
- the class to which to dispatch controlpublic int getEncodedByteSize()
TokenType
getEncodedByteSize
in interface TokenType
Copyright © 2020 Actian Corporation. All rights reserved.