-
- All Superinterfaces:
TokenTyped
- All Known Subinterfaces:
BinaryTokenSequence,BooleanTokenSequence,CharTokenSequence,DateTokenSequence,DoubleTokenSequence,DurationTokenSequence,FloatTokenSequence,IntTokenSequence,Ip4AddressTokenSequence,Ip6AddressTokenSequence,LongTokenSequence,MoneyTokenSequence,MutableBinaryTokenSequence,MutableBooleanTokenSequence,MutableCharTokenSequence,MutableDateTokenSequence,MutableDoubleTokenSequence,MutableDurationTokenSequence,MutableFloatTokenSequence,MutableIntTokenSequence,MutableIp4AddressTokenSequence,MutableIp6AddressTokenSequence,MutableLongTokenSequence,MutableMoneyTokenSequence,MutableNumericTokenSequence,MutableObjectTokenSequence<O>,MutablePeriodTokenSequence,MutableRecordTokenSequence,MutableScalarTokenSequence,MutableStringTokenSequence,MutableTimestampTokenSequence,MutableTimeTokenSequence,MutableTokenSequence,NumericTokenSequence,ObjectTokenSequence<O>,PeriodTokenSequence,RecordTokenSequence,ScalarTokenSequence,StringTokenSequence,TimestampTokenSequence,TimeTokenSequence
- All Known Implementing Classes:
AbstractScalarTokenSequence,BinaryTokenList,BooleanTokenList,CharTokenList,CompositeTokenSequence,DateTokenList,DoubleTokenList,DurationTokenList,FloatTokenList,IntTokenList,Ip4AddressTokenList,Ip6AddressTokenList,LongTokenList,MoneyTokenList,NumericTokenList,ObjectTokenList,PeriodTokenList,RecordTokenList,SparseBinaryTokenList,SparseBooleanTokenList,SparseCharTokenList,SparseDateTokenList,SparseDoubleTokenList,SparseDurationTokenList,SparseFloatTokenList,SparseIntTokenList,SparseIp4AddressTokenList,SparseIp6AddressTokenList,SparseLongTokenList,SparseMoneyTokenList,SparseNumericTokenList,SparseObjectTokenList,SparsePeriodTokenList,SparseRecordTokenList,SparseStringTokenList,SparseTimestampTokenList,SparseTimeTokenList,StringTokenList,TimestampTokenList,TimeTokenList
public interface TokenSequence extends TokenTyped
A random-access, read-only view of a sequence of data tokens of homogeneous type. Sequences are zero-indexed, just as Java arrays are.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompareElement(int index, TokenValued value)Compares the value of the specified token to the token at which the given port is positioned.intcompareElements(int lhsIndex, int rhsIndex)Compares the values of the tokens at the specified positions.ElementComparatorgetElementComparator(TokenOrder sortOrder)Gets anElementComparatorfor this sequence using the specified ordering.TokenValuedgetToken(int index)Gets the value at the specified position.inthashCode(int index)Gets the hash code for the token at the specified position.booleanisNull(int index)Indicates whether the specified token has a null value.TokenValuedIteratornewValueIterator()Creates an iterator over the non-null values of this sequence.intsize()Gets the length of the sequence.StringtoString(int index)Gets the string representation of the token at the specified position.-
Methods inherited from interface com.pervasive.datarush.types.TokenTyped
getType
-
-
-
-
Method Detail
-
size
int size()
Gets the length of the sequence.- Returns:
- the number of tokens in the sequence.
-
isNull
boolean isNull(int index)
Indicates whether the specified token has a null value.- Parameters:
index- the index of the token- Returns:
trueif the element is null,falseotherwise
-
compareElement
int compareElement(int index, TokenValued value)Compares the value of the specified token to the token at which the given port is positioned.- Parameters:
index- the index of the tokenvalue- the input port positioned at the token for comparison- Returns:
0if the values are equal,1if the sequence token value is greater,-1if the sequence token value is lesser. A null value is greater than any other non-null; two null values compare as equal.
-
compareElements
int compareElements(int lhsIndex, int rhsIndex)Compares the values of the tokens at the specified positions.- Parameters:
lhsIndex- the index of the left-hand elementrhsIndex- the index of the right-hand element- Returns:
0if the values are equal,1if the left hand value is greater,-1if the left hand value is lesser. A null value is greater than any other non-null; two null values compare as equal.
-
getElementComparator
ElementComparator getElementComparator(TokenOrder sortOrder)
Gets anElementComparatorfor this sequence using the specified ordering.- Parameters:
sortOrder- the desired ordering- Returns:
- an
ElementComparatorfor this sequence.
-
getToken
TokenValued getToken(int index)
Gets the value at the specified position.- Parameters:
index- the index of the token- Returns:
- the value
-
hashCode
int hashCode(int index)
Gets the hash code for the token at the specified position.- Parameters:
index- the index of the token- Returns:
- the hash code for the token
-
toString
String toString(int index)
Gets the string representation of the token at the specified position.- Parameters:
index- the index of the token- Returns:
- the string representation of the token
-
newValueIterator
TokenValuedIterator newValueIterator()
Creates an iterator over the non-null values of this sequence. The iterator will automatically be reset as modifications are made to the sequence.- Returns:
- an newly-created iterator over the non-null values of this sequence.
-
-