O - the type of Java objects in the listpublic final class ObjectTokenList<O> extends AbstractScalarTokenSequence implements MutableObjectTokenSequence<O>
MutableObjectTokenSequence.TokenTypeConstant#OBJECT(Class)| Constructor and Description |
|---|
ObjectTokenList(ObjectTokenType<O> type,
int capacity)
Create an empty array
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(O value)
Appends the specified object to this sequence.
|
void |
append(O value,
int count)
Appends the specified object to this sequence
multiple times.
|
void |
fill(int start,
int length,
O value)
Sets the tokens in the specified subsequence to the given object value.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
O |
getObject(int i)
Gets the value of the specified token as an object.
|
ObjectValued<O> |
getToken(int index)
Gets the value at the specified position.
|
ObjectSettable<O> |
getTokenSetter(int index)
Returns a mutator for the given index.
|
ObjectTokenType<O> |
getType()
Gets the data type of the tokens in the sequence.
|
void |
getValues(int index,
O[] 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.
|
ObjectValuedIterator<O> |
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 |
setObject(int index,
O value)
Sets the token at the specified position to the given object value.
|
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 ObjectTokenList(ObjectTokenType<O> type, int capacity)
type - the type of objects in the listcapacity - the initial capacity.public ObjectTokenType<O> getType()
ScalarTokenSequencegetType in interface ObjectTokenSequence<O>getType in interface ScalarTokenSequencegetType in interface ObjectTyped<O>getType in interface ScalarTypedgetType in interface TokenTypedpublic O getObject(int i)
ObjectTokenSequenceThis is a reference to the object representing the value. If the object is mutable, changing it modifies the value of the token in the sequence.
getObject in interface ObjectTokenSequence<O>i - the position of the token in the sequencenull is returned.public ObjectValued<O> getToken(int index)
TokenSequencegetToken in interface ObjectTokenSequence<O>getToken in interface ScalarTokenSequencegetToken in interface TokenSequenceindex - the index of the tokenpublic ObjectSettable<O> getTokenSetter(int index)
MutableTokenSequencegetTokenSetter in interface MutableTokenSequencegetTokenSetter in interface MutableObjectTokenSequence<O>getTokenSetter in interface MutableScalarTokenSequenceindex - the positionpublic void getValues(int index,
O[] values,
boolean[] nullFlags,
int offset,
int length)
ObjectTokenSequenceReferences to the objects representing the token values are returned. If these objects are mutable, changing any modifies the values of the tokens in the sequence.
getValues in interface ObjectTokenSequence<O>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)
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 boolean isZero(int index)
ScalarTokenSequenceisZero in interface ScalarTokenSequenceindex - the index of the tokentrue if the element is zero,
false otherwisepublic void setObject(int index,
O value)
setObject in interface MutableObjectTokenSequence<O>index - the position of the token in the arrayvalue - the object value to which to set the token. Passing
null is equivalent to calling setNull(index).public void fill(int start,
int length,
O value)
start - the starting index of the subsequence in the arraylength - the length of the subsequencevalue - the numeric 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 void append(O value)
MutableObjectTokenSequenceappend in interface MutableObjectTokenSequence<O>value - the value to append. If null,
this is equivalent to appendNull().public void append(O value, int count)
MutableObjectTokenSequenceappend in interface MutableObjectTokenSequence<O>value - the value to append. If null,
this is equivalent to appendNull(count).count - the number of copies to append.public ObjectValuedIterator<O> newValueIterator()
TokenSequencenewValueIterator in interface ObjectTokenSequence<O>newValueIterator in interface ScalarTokenSequencenewValueIterator in interface TokenSequenceCopyright © 2020 Actian Corporation. All rights reserved.