java.lang.Object
com.pervasive.datarush.tokens.record.AbstractRecordValued<ScalarToken>
com.pervasive.datarush.tokens.record.RecordToken
- All Implemented Interfaces:
DataToken,RecordValued,TokenValued,RecordTyped,TokenTyped,Serializable,Comparable<RecordToken>
public final class RecordToken
extends AbstractRecordValued<ScalarToken>
implements DataToken, Comparable<RecordToken>
A composite token of scalar valued tokens; an immutable
RecordValued object.
A RecordToken can also be thought of as a row of tabular data.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRecordToken(RecordValued value) Constructs a new token with the composite value in the given container.RecordToken(ScalarValued... fieldValues) Constructs a new token using the field values in the given containers.RecordToken(RecordTokenType type, ScalarValued... fieldValues) Constructs a new token with the specified field types, using the field values in the given containers. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(RecordToken that) booleanIndicates whether another object is equal to this token.inthashCode()Returns a hash code for the token.static RecordTokenNULL(RecordTokenType recordType) Create a new null valued record token of the specified type.static RecordTokenwrap(String name, ScalarValued value) Create a new record token with a single field with the specified name and value.static RecordTokenZERO(RecordTokenType recordType) Create a new zero valued record token of the specified type.Methods inherited from class com.pervasive.datarush.tokens.record.AbstractRecordValued
containsNull, getConverter, getField, getField, getFields, getType, isNull, newFieldIterator, newFieldIterator, newFieldIterator, size, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pervasive.datarush.tokens.TokenValued
isNull
-
Constructor Details
-
RecordToken
Constructs a new token with the composite value in the given container. The resulting token has the same schema as the value.- Parameters:
value- aRecordValuedcontaining the desired value
-
RecordToken
Constructs a new token using the field values in the given containers. A record type with default names will be generated for the token.- Parameters:
fieldValues- the values for the fields of the composite token.
-
RecordToken
Constructs a new token with the specified field types, using the field values in the given containers.The list of scalar values are expected in the same order as the fields in the provided type.
- Parameters:
type- the schema of the composite tokenfieldValues- the values for the fields of the composite token.
-
-
Method Details
-
NULL
Create a new null valued record token of the specified type. All fields will be null valued.- Parameters:
recordType- the record token type of the token to create- Returns:
- a null valued record token
-
ZERO
Create a new zero valued record token of the specified type. All fields will be zero valued.- Parameters:
recordType- the record token type of the token to create- Returns:
- a zero valued record token
-
compareTo
- Specified by:
compareToin interfaceComparable<RecordToken>
-
equals
Description copied from interface:DataTokenIndicates 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
public int hashCode()Description copied from interface:DataTokenReturns a hash code for the token. This value is guaranteed to be consistent with that returned byTokenConverter.asHashCode(TokenValued). -
wrap
Create a new record token with a single field with the specified name and value.- Parameters:
name- the name of the single field in the resultvalue- the value of the single field in the result- Returns:
- the resulting token
-