- All Superinterfaces:
Serializable,TokenTyped,TokenValued
- All Known Subinterfaces:
ScalarToken
- All Known Implementing Classes:
BinaryToken,BooleanToken,CharToken,DateToken,DoubleToken,DurationToken,FloatToken,IntToken,Ip4AddressToken,Ip6AddressToken,LongToken,MoneyToken,NullToken,NumericToken,ObjectToken,PeriodToken,RecordToken,StringToken,TimestampToken,TimeToken
An immutable
TokenValued object. In addition to adding immutability
to the TokenValued contract, implementations of DataToken also
implement a number of useful features:
- a type-appropriate
Comparableinterface - an overrides of
Object.hashCode()consistent with the values returned byTokenConverter. - an override of
Object.equals()which considers null valued tokens equal, as opposed to to different (as inTokenComparator).
DataTokens a useful mechanism for general
in-memory storage of token values.- See Also:
-
Method Summary
Methods inherited from interface com.pervasive.datarush.tokens.TokenValued
getType, isNull
-
Method Details
-
equals
Indicates whether another object is equal to this token. Two null valued tokens are considered equal. This differs from the behavior ofTokenComparator.equal(TokenValued,TokenValued)but makes it possible to storeDataTokens inMaps. -
hashCode
int hashCode()Returns a hash code for the token. This value is guaranteed to be consistent with that returned byTokenConverter.asHashCode(TokenValued). -
toString
String toString()Returns a string representation of the token's value. This value is guaranteed to be consistent with that returned byTokenConverter.asString(TokenValued}.
-