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, wait
getTokenSetter
getToken, getType, isZero, newValueIterator
protected 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()
ScalarTokenSequence
isNull
in interface ScalarTokenSequence
public final long getModificationCount()
MutableScalarTokenSequence
getModificationCount
in interface MutableScalarTokenSequence
public final int size()
TokenSequence
size
in interface TokenSequence
public final boolean isNull(int i)
TokenSequence
isNull
in interface TokenSequence
i
- the index of the tokentrue
if the element is null,
false
otherwisepublic final int compareElement(int index, TokenValued value)
TokenSequence
compareElement
in interface TokenSequence
index
- 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)
TokenSequence
compareElements
in interface TokenSequence
lhsIndex
- 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)
TokenSequence
ElementComparator
for this sequence using
the specified ordering.getElementComparator
in interface TokenSequence
sortOrder
- the desired orderingElementComparator
for this sequence.public final int hashCode(int index)
TokenSequence
hashCode
in interface TokenSequence
index
- the index of the tokenpublic final String toString(int index)
TokenSequence
toString
in interface TokenSequence
index
- the index of the tokenpublic final void ensureCanonical()
MutableScalarTokenSequence
ensureCanonical
in interface MutableScalarTokenSequence
public final int remaining()
public final int capacity()
public void appendNull()
appendNull
in interface MutableTokenSequence
public void appendNull(int count)
appendNull
in interface MutableTokenSequence
count
- the number of null values to appendpublic final void appendZero()
MutableTokenSequence
appendZero
in interface MutableTokenSequence
public final void appendZero(int count)
MutableTokenSequence
appendZero
in interface MutableTokenSequence
count
- the number of zero values to appendpublic void reset()
MutableTokenSequence
reset
in interface MutableTokenSequence
public void append(TokenValued in)
TokenAppendable
The 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 TokenAppendable
in
- the token value to appendpublic void append(TokenValued in, long count)
TokenAppendable
The 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 TokenAppendable
in
- the token value to appendcount
- the number of copies to appendpublic void append(TokenSequence data)
TokenAppendable
The data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
append
in interface TokenAppendable
data
- the sequence to appendpublic void append(TokenSequence data, int start, int length)
TokenAppendable
The data types of the sequences must be compatible. If not identical, appropriate coercion will be attempted.
append
in interface TokenAppendable
data
- 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.