public final class BinaryTokenList extends AbstractScalarTokenSequence implements MutableBinaryTokenSequence
MutableBinaryTokenSequence.TokenTypeConstant.BINARY| Constructor and Description |
|---|
BinaryTokenList(int initialCapacity)
Create an empty array of binary tokens
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(byte[] value)
Appends the specified binary value to this sequence.
|
void |
append(byte[] value,
int count)
Appends the specified binary value to this sequence
multiple times.
|
void |
appendReference(byte[] value)
Appends the specified binary value to this sequence.
|
void |
appendReference(byte[] value,
int count)
Appends the specified binary value to this sequence
multiple times.
|
void |
fill(int start,
int length,
byte[] value)
Sets the tokens in the specified subsequence to the given binary value.
|
void |
fillRef(int start,
int length,
byte[] value)
Sets the tokens in the specified subsequence to the given byte array reference.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
byte[] |
getBinary(int i)
Gets the value of the specified token as
a binary value.
|
byte[] |
getBinaryRef(int i)
Gets the value of the specified token as
a binary value.
|
BinaryValued |
getToken(int index)
Gets the value at the specified position.
|
BinarySettable |
getTokenSetter(int index)
Returns a mutator for the given index.
|
ScalarTokenType |
getType()
Gets the data type of the tokens in the sequence.
|
void |
getValues(int index,
byte[][] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens.
|
boolean |
isZero(int index)
Indicates whether the specified token has a zero value.
|
BinaryValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
set(int index,
byte[] value)
Sets the token at the specified position to the given binary value.
|
void |
setNull(int index)
Sets the token at the specified position to be null valued.
|
void |
setNull(int start,
int length)
Sets the tokens in the specified subsequence to be null valued.
|
void |
setRef(int index,
byte[] value)
Sets the token at the specified position to the given byte array reference.
|
void |
setValue(int index,
TokenValued value)
Sets the token at the specified position to the given value.
|
void |
setValues(int start,
TokenSequence values,
int offset,
int length)
Sets the tokens in the specified subsequence of the array
to the corresponding values from a subsequence of the given source
sequence.
|
void |
setZero(int index)
Sets the token at the specified position to be zero valued.
|
void |
setZero(int start,
int length)
Sets the tokens in the specified subsequence to be zero valued.
|
append, append, append, append, appendNull, appendNull, appendZero, appendZero, capacity, compareElement, compareElements, ensureCanonical, getElementComparator, getModificationCount, hashCode, isNull, isNull, map, remaining, reset, size, toString, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitensureCanonical, getModificationCountisNullappendNull, appendNull, appendZero, appendZero, resetcompareElement, compareElements, getElementComparator, hashCode, isNull, size, toStringappend, append, append, appendpublic BinaryTokenList(int initialCapacity)
initialCapacity - the initial capacity.public ScalarTokenType getType()
ScalarTokenSequencegetType in interface ScalarTokenSequencegetType in interface ScalarTypedgetType in interface TokenTypedpublic byte[] getBinary(int i)
BinaryTokenSequenceA copy of the value is returned.
getBinary in interface BinaryTokenSequencei - the position of the token in the sequencenull is returned.public byte[] getBinaryRef(int i)
BinaryTokenSequenceA reference to the value of the token is returned. Modifying this reference modifies the value of the token in the sequence.
getBinaryRef in interface BinaryTokenSequencei - the position of the token in the sequencenull is returned.public BinaryValued getToken(int index)
TokenSequencegetToken in interface BinaryTokenSequencegetToken in interface ScalarTokenSequencegetToken in interface TokenSequenceindex - the index of the tokenpublic BinarySettable getTokenSetter(int index)
MutableTokenSequencegetTokenSetter in interface MutableTokenSequencegetTokenSetter in interface MutableBinaryTokenSequencegetTokenSetter in interface MutableScalarTokenSequenceindex - the positionpublic void getValues(int index,
byte[][] values,
boolean[] nullFlags,
int offset,
int length)
BinaryTokenSequenceReferences to the values of the tokens are returned. Modifying these references modify the values of the tokens in the sequence.
getValues in interface BinaryTokenSequenceindex - the starting index of the rangevalues - an array into which to place element valuesnullFlags - an array into which to place null indicator valuesoffset - the starting offset into the target arrays. That is,
elements[offset] and nulls[offset] will get the
value and null indicator respectively of the token at position
start, and so on.length - number of tokens to getpublic void setNull(int index)
MutableTokenSequencesetNull in interface MutableTokenSequenceindex - the position of the token in the arraypublic void setNull(int start,
int length)
MutableTokenSequencesetNull in interface MutableTokenSequencestart - the starting index of the subsequence in the arraylength - the length of the subsequencepublic void setZero(int index)
MutableTokenSequencesetZero in interface MutableTokenSequenceindex - the position of the token in the arraypublic void setZero(int start,
int length)
MutableTokenSequencesetZero in interface MutableTokenSequencestart - the starting index of the subsequence in the arraylength - the length of the subsequencepublic void set(int index,
byte[] value)
The input array is copied to prevent later modification of the value
that is set. To avoid this overhead and prevent the data copy,
use the setRef(int,byte[]) method instead.
set in interface MutableBinaryTokenSequenceindex - the position of the token in the arrayvalue - the binary value to which to set the token.
Passing null is equivalent to calling setNull(index).public void fill(int start,
int length,
byte[] value)
The input array is copied to prevent later modification of the value
that is set. To avoid this overhead and prevent the data copy,
use the fillRef(int,int,byte[]) method instead.
start - the starting index of the subsequence in the arraylength - the length of the subsequencevalue - the binary value to which to set the tokens.
Passing null is equivalent to calling setNull(start, length).public void setRef(int index,
byte[] value)
While this call avoids the overhead seen with set(int,byte[]),
subsequent modification of the value will modify the token value in the array.
setRef in interface MutableBinaryTokenSequenceindex - the position of the token in the arrayvalue - the binary value to which to set the token.
Passing null is equivalent to calling setNull(index).public void fillRef(int start,
int length,
byte[] value)
While this call avoids the overhead seen with fill(int,int,byte[]),
subsequent modification of the value will modify the token value.
start - the starting index of the subsequence in the arraylength - the length of the subsequencevalue - the binary value to which to set the tokens.
Passing null is equivalent to calling setNull(start, length).public void setValue(int index,
TokenValued value)
MutableTokenSequencesetValue in interface MutableTokenSequenceindex - the position of the token in the arrayvalue - the value to which to set the token. This value
must be of an appropriate type for the array.public void fillValue(int start,
int length,
TokenValued value)
MutableTokenSequencefillValue in interface MutableTokenSequencestart - the starting index of the subsequence in the arraylength - the length of the subsequencevalue - the value to which to set the tokens. This value
must be of an appropriate type for the arraypublic void setValues(int start,
TokenSequence values,
int offset,
int length)
MutableTokenSequencesetValues in interface MutableTokenSequencestart - the starting index of the subsequence in the arrayvalues - the source sequence. This sequence must be
of an appropriate type for the array.offset - the starting index in the source sequence.
Corresponding values will be taken relative to this position.
That is, the value of the token at position offset in
values will be assigned to the token at position
start, and so on.length - the number of tokens to copypublic final void append(byte[] value)
MutableBinaryTokenSequenceA copy of the input will be made.
append in interface MutableBinaryTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull().public final void appendReference(byte[] value)
MutableBinaryTokenSequenceA reference to the input value will be stored; subsequent modification of the input modifies the stored value.
appendReference in interface MutableBinaryTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull().public void append(byte[] value,
int count)
MutableBinaryTokenSequenceA copy of the input will be made.
append in interface MutableBinaryTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull(count).count - the number of copies to append.public void appendReference(byte[] value,
int count)
MutableBinaryTokenSequenceA reference to the input value will be stored; subsequent modification of the input modifies the stored value.
appendReference in interface MutableBinaryTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull(count).count - the number of copies to append.public BinaryValuedIterator newValueIterator()
TokenSequencenewValueIterator in interface BinaryTokenSequencenewValueIterator in interface ScalarTokenSequencenewValueIterator in interface TokenSequencepublic boolean isZero(int index)
ScalarTokenSequenceisZero in interface ScalarTokenSequenceindex - the index of the tokentrue if the element is zero,
false otherwiseCopyright © 2020 Actian Corporation. All rights reserved.