public abstract class AbstractScalarTokenSequence extends Object implements MutableScalarTokenSequence
TokenSequence containing scalar typed tokens.
The scalar token types are enumerated in TokenTypeConstant.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScalarTokenSequence(boolean[] nullFlags,
int capacity,
int length)
Create a ScalarTokenSequence backed with the specified data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(TokenSequence data)
Appends all tokens in the specified sequence to this
sequence.
|
void |
append(TokenSequence data,
int start,
int length)
Appends a subsequence of tokens in the specified sequence
to this sequence.
|
void |
append(TokenValued in)
Appends the specified token value to this sequence.
|
void |
append(TokenValued in,
long count)
Appends the specified token value to this sequence
multiple times.
|
void |
appendNull()
Append a null value to this sequence.
|
void |
appendNull(int count)
Append a null value to this sequence.
|
void |
appendZero()
Appends a zero value to this sequence.
|
void |
appendZero(int count)
Appends the specified number of zero values to this sequence.
|
int |
capacity()
Gets the maximum capacity of the sequence.
|
int |
compareElement(int index,
TokenValued value)
Compares the value of the specified token to the token at which
the given port is positioned.
|
int |
compareElements(int lhsIndex,
int rhsIndex)
Compares the values of the tokens at the specified
positions.
|
void |
ensureCanonical()
Ensures that the internal representation is in a canonical form such
that it can be read safely by multiple threads.
|
ElementComparator |
getElementComparator(TokenOrder sortOrder)
Gets an
ElementComparator for this sequence using
the specified ordering. |
long |
getModificationCount()
Returns the current modification count.
|
int |
hashCode(int index)
Gets the hash code for the token at the specified position.
|
boolean |
isNull()
Returns whether all elements are null.
|
boolean |
isNull(int i)
Indicates whether the specified token has a null value.
|
void |
map(int[] sortOrder)
Remaps the sequence according to the specified ordering.
|
int |
remaining()
Gets the remaining capacity of the sequence.
|
void |
reset()
Removes all elements from the sequence.
|
int |
size()
Gets the length of the sequence.
|
String |
toString() |
String |
toString(int index)
Gets the string representation of the token at the specified
position.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTokenSettergetToken, getType, isZero, newValueIteratorprotected AbstractScalarTokenSequence(boolean[] nullFlags,
int capacity,
int length)
nullFlags - the null flags for array elements;capacity - the capacitylength - the number of elements in the arraypublic boolean isNull()
ScalarTokenSequenceisNull in interface ScalarTokenSequencepublic final long getModificationCount()
MutableScalarTokenSequencegetModificationCount in interface MutableScalarTokenSequencepublic final int size()
TokenSequencesize in interface TokenSequencepublic final boolean isNull(int i)
TokenSequenceisNull in interface TokenSequencei - the index of the tokentrue if the element is null,
false otherwisepublic final int compareElement(int index,
TokenValued value)
TokenSequencecompareElement in interface TokenSequenceindex - the index of the tokenvalue - the input port positioned at the token for
comparison0 if the values are equal,
1 if the sequence token value is greater,
-1 if the sequence token value is lesser.
A null value is greater than any other non-null;
two null values compare as equal.public final int compareElements(int lhsIndex,
int rhsIndex)
TokenSequencecompareElements in interface TokenSequencelhsIndex - the index of the left-hand elementrhsIndex - the index of the right-hand element0 if the values are equal,
1 if the left hand value is greater,
-1 if the left hand value is lesser.
A null value is greater than any other non-null;
two null values compare as equal.public final ElementComparator getElementComparator(TokenOrder sortOrder)
TokenSequenceElementComparator for this sequence using
the specified ordering.getElementComparator in interface TokenSequencesortOrder - the desired orderingElementComparator for this sequence.public final int hashCode(int index)
TokenSequencehashCode in interface TokenSequenceindex - the index of the tokenpublic final String toString(int index)
TokenSequencetoString in interface TokenSequenceindex - the index of the tokenpublic final void ensureCanonical()
MutableScalarTokenSequenceensureCanonical in interface MutableScalarTokenSequencepublic final int remaining()
public final int capacity()
public void appendNull()
appendNull in interface MutableTokenSequencepublic void appendNull(int count)
appendNull in interface MutableTokenSequencecount - the number of null values to appendpublic final void appendZero()
MutableTokenSequenceappendZero in interface MutableTokenSequencepublic final void appendZero(int count)
MutableTokenSequenceappendZero in interface MutableTokenSequencecount - the number of zero values to appendpublic void reset()
MutableTokenSequencereset in interface MutableTokenSequencepublic void append(TokenValued in)
TokenAppendableThe data types of the sequence and the value must be compatible. If the types are not identical, appropriate coercion will be attempted.
append in interface TokenAppendablein - the token value to appendpublic void append(TokenValued in, long count)
TokenAppendableThe data types of the sequence and the value must be compatible. If the types are not identical, appropriate coercion will be attempted.
append in interface TokenAppendablein - the token value to appendcount - the number of copies to appendpublic void append(TokenSequence data)
TokenAppendableThe data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
append in interface TokenAppendabledata - the sequence to appendpublic void append(TokenSequence data, int start, int length)
TokenAppendableThe data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
append in interface TokenAppendabledata - the sequence containing tokens to appendstart - the starting index of the subsequence in the sourcelength - the length of the subsequencepublic final void map(int[] sortOrder)
sortOrder - the reording of the sequenceCopyright © 2020 Actian Corporation. All rights reserved.