public final class StringTokenList extends AbstractScalarTokenSequence
MutableStringTokenSequence
.TokenTypeConstant#STRING
Constructor and Description |
---|
StringTokenList(int capacity)
Create a new array of string tokens with the specified number of elements.
|
Modifier and Type | Method and Description |
---|---|
void |
append(String value)
Appends the specified string to this sequence.
|
void |
append(String value,
int count)
Appends the specified string to this sequence
multiple times.
|
int |
compareElement(int index,
String value) |
protected void |
expandValueBuffers(int capacity) |
void |
fillString(int start,
int length,
String value)
Sets the tokens in the specified subsequence to the given string value.
|
void |
fillValue(int startIndex,
int count,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
String |
getString(int i)
Gets the value of the specified element as
a string.
|
StringValued |
getToken(int index)
Gets the value at the specified position.
|
StringSettable |
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,
String[] 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.
|
StringValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
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 |
setString(int index,
String value)
Sets the token at the specified position to the given string value.
|
void |
setValue(int position,
TokenValued value)
Sets the token at the specified position to the given value.
|
void |
setValues(int startIndex,
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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
ensureCanonical, getModificationCount
isNull
appendNull, appendNull, appendZero, appendZero, reset
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
append, append, append, append
public StringTokenList(int capacity)
capacity
- the number of string tokens in the arraypublic String getString(int i)
StringTokenSequence
i
- the position of the token in the sequencepublic void getValues(int index, String[] values, boolean[] nullFlags, int offset, int length)
StringTokenSequence
index
- 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)
MutableTokenSequence
index
- the position of the token in the arraypublic void setNull(int start, int length)
MutableTokenSequence
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencepublic void setZero(int index)
MutableTokenSequence
index
- the position of the token in the arraypublic void setZero(int start, int length)
MutableTokenSequence
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencepublic boolean isZero(int index)
ScalarTokenSequence
index
- the index of the tokentrue
if the element is zero,
false
otherwisepublic void setString(int index, String value)
index
- the position of the token in the arrayvalue
- the string value to which to set the token. Passing
null
is equivalent to calling setNull(index)
.public void fillString(int start, int length, String value)
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencevalue
- the string value to which to set the tokens. Passing
null
is equivalent to calling setNull(start, length)
.public void setValue(int position, TokenValued value)
MutableTokenSequence
position
- 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 startIndex, int count, TokenValued value)
MutableTokenSequence
startIndex
- the starting index of the subsequence in the arraycount
- 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 startIndex, TokenSequence values, int offset, int length)
MutableTokenSequence
startIndex
- 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 copyprotected void expandValueBuffers(int capacity)
public void append(String value)
MutableStringTokenSequence
value
- the value to append. If null
,
this is equivalent to appendNull()
.public void append(String value, int count)
MutableStringTokenSequence
value
- the value to append. If null
,
this is equivalent to appendNull(count)
.count
- the number of copies to append.public StringValuedIterator newValueIterator()
TokenSequence
public final ScalarTokenType getType()
ScalarTokenSequence
getType
in interface ScalarTokenSequence
getType
in interface ScalarTyped
getType
in interface TokenTyped
public final int compareElement(int index, String value)
public final StringValued getToken(int index)
TokenSequence
getToken
in interface ScalarTokenSequence
getToken
in interface StringTokenSequence
getToken
in interface TokenSequence
index
- the index of the tokenpublic final StringSettable getTokenSetter(int index)
MutableTokenSequence
getTokenSetter
in interface MutableTokenSequence
getTokenSetter
in interface MutableScalarTokenSequence
getTokenSetter
in interface MutableStringTokenSequence
index
- the positionCopyright © 2020 Actian Corporation. All rights reserved.