public final class CharTokenList extends AbstractScalarTokenSequence implements MutableCharTokenSequence
MutableCharTokenSequence
.TokenTypeConstant.CHAR
Constructor and Description |
---|
CharTokenList(int initialCapacity)
Create an empty array
|
Modifier and Type | Method and Description |
---|---|
void |
append(char value)
Appends the specified character to this sequence.
|
void |
append(char value,
int count)
Appends the specified character to this sequence
multiple times.
|
void |
appendChars(CharSequence seq)
Appends the specified character sequence to this sequence.
|
void |
appendChars(CharSequence seq,
int start,
int length)
Appends a subsequence of the specified character sequence
to this sequence.
|
char |
charAt(int index) |
void |
fillChar(int start,
int length,
char value)
Sets the tokens in the specified subsequence to the given character value.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
char |
getChar(int i)
Gets the value of the specified token as
a
char . |
String |
getString(int start,
int length)
Gets a subsequence of tokens as a string.
|
CharValued |
getToken(int index)
Gets the value at the specified position.
|
CharSettable |
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,
char[] 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.
|
int |
length() |
CharValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
setChar(int index,
char value)
Sets the token at the specified position to the given character 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 |
setValue(int index,
TokenValued value)
Sets the token at the specified position to the given value.
|
void |
setValues(int start,
CharSequence 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
CharSequence . |
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.
|
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
append, append, append, append, appendNull, appendNull, appendZero, appendZero, capacity, compareElement, compareElements, ensureCanonical, getElementComparator, getModificationCount, hashCode, isNull, isNull, map, remaining, reset, size, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
ensureCanonical, getModificationCount
isNull
appendNull, appendNull, appendZero, appendZero, reset
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
append, append, append, append
public CharTokenList(int initialCapacity)
initialCapacity
- the initial capacity.public ScalarTokenType getType()
ScalarTokenSequence
getType
in interface ScalarTokenSequence
getType
in interface ScalarTyped
getType
in interface TokenTyped
public char getChar(int i)
CharTokenSequence
char
.getChar
in interface CharTokenSequence
i
- the position of the token in the sequenceCharacter.MAX_VALUE
is returned.public String getString(int start, int length)
CharTokenSequence
Character.MAX_VALUE
.getString
in interface CharTokenSequence
start
- the index of the first token in the
subsequencelength
- the length of the subsequencepublic final int length()
length
in interface CharSequence
public final char charAt(int index)
charAt
in interface CharSequence
public final CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public final String toString()
toString
in interface CharSequence
toString
in class AbstractScalarTokenSequence
public CharValued getToken(int index)
TokenSequence
getToken
in interface CharTokenSequence
getToken
in interface ScalarTokenSequence
getToken
in interface TokenSequence
index
- the index of the tokenpublic CharSettable getTokenSetter(int index)
MutableTokenSequence
getTokenSetter
in interface MutableTokenSequence
getTokenSetter
in interface MutableCharTokenSequence
getTokenSetter
in interface MutableScalarTokenSequence
index
- the positionpublic void getValues(int index, char[] values, boolean[] nullFlags, int offset, int length)
CharTokenSequence
getValues
in interface CharTokenSequence
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
setNull
in interface MutableTokenSequence
index
- the position of the token in the arraypublic void setNull(int start, int length)
MutableTokenSequence
setNull
in interface MutableTokenSequence
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencepublic void setZero(int index)
MutableTokenSequence
setZero
in interface MutableTokenSequence
index
- the position of the token in the arraypublic void setZero(int start, int length)
MutableTokenSequence
setZero
in interface MutableTokenSequence
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencepublic final boolean isZero(int index)
ScalarTokenSequence
isZero
in interface ScalarTokenSequence
index
- the index of the tokentrue
if the element is zero,
false
otherwisepublic void setChar(int index, char value)
setChar
in interface MutableCharTokenSequence
index
- the position of the token in the arrayvalue
- the character value to which to set the tokenpublic void fillChar(int start, int length, char value)
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencevalue
- the character value to which to set the tokenspublic void setValue(int index, TokenValued value)
MutableTokenSequence
setValue
in interface MutableTokenSequence
index
- 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)
MutableTokenSequence
fillValue
in interface MutableTokenSequence
start
- 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)
MutableTokenSequence
setValues
in interface MutableTokenSequence
start
- 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 void setValues(int start, CharSequence values, int offset, int length)
CharSequence
.start
- the starting index of the subsequence in the arrayvalues
- the source CharSequence
offset
- the starting index in the source sequence.
Corresponding values will be taken relative to this position.
That is, the character at position offset
in
values
will be assigned to the token at position
start
, and so on.length
- the number of values to copypublic void append(char value)
MutableCharTokenSequence
append
in interface MutableCharTokenSequence
value
- the value to append.public void append(char value, int count)
MutableCharTokenSequence
append
in interface MutableCharTokenSequence
value
- the value to append.count
- the number of copies to append.public void appendChars(CharSequence seq)
MutableCharTokenSequence
appendChars
in interface MutableCharTokenSequence
seq
- the character sequence to append.public void appendChars(CharSequence seq, int start, int length)
MutableCharTokenSequence
appendChars
in interface MutableCharTokenSequence
seq
- the character sequence to append.start
- the index of the initial character in the
subsequencelength
- the length of the subsequencepublic CharValuedIterator newValueIterator()
TokenSequence
newValueIterator
in interface CharTokenSequence
newValueIterator
in interface ScalarTokenSequence
newValueIterator
in interface TokenSequence
Copyright © 2024 Actian Corporation. All rights reserved.