- 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 immutableRecordValued
object. ARecordToken
can also be thought of as a row of tabular data.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RecordToken(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(RecordToken that)
boolean
equals(Object obj)
Indicates whether another object is equal to this token.int
hashCode()
Returns a hash code for the token.static RecordToken
NULL(RecordTokenType recordType)
Create a new null valued record token of the specified type.static RecordToken
wrap(String name, ScalarValued value)
Create a new record token with a single field with the specified name and value.static RecordToken
ZERO(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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.tokens.TokenValued
isNull
-
-
-
-
Constructor Detail
-
RecordToken
public RecordToken(RecordValued value)
Constructs a new token with the composite value in the given container. The resulting token has the same schema as the value.- Parameters:
value
- aRecordValued
containing the desired value
-
RecordToken
public RecordToken(ScalarValued... fieldValues)
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
public RecordToken(RecordTokenType type, ScalarValued... fieldValues)
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 Detail
-
NULL
public static RecordToken NULL(RecordTokenType recordType)
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
public static RecordToken ZERO(RecordTokenType recordType)
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
public int compareTo(RecordToken that)
- Specified by:
compareTo
in interfaceComparable<RecordToken>
-
equals
public boolean equals(Object obj)
Description copied from interface:DataToken
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 storeDataToken
s inMap
s.
-
hashCode
public int hashCode()
Description copied from interface:DataToken
Returns a hash code for the token. This value is guaranteed to be consistent with that returned byTokenConverter.asHashCode(TokenValued)
.
-
wrap
public static RecordToken wrap(String name, ScalarValued value)
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
-
-