public final class IntTokenList extends AbstractScalarTokenSequence implements MutableIntTokenSequence
MutableIntTokenSequence
.TokenTypeConstant.INT
Constructor and Description |
---|
IntTokenList(int capacity)
Create an empty array
|
Modifier and Type | Method and Description |
---|---|
void |
append(int value)
Appends the specified integer to this sequence.
|
void |
append(int value,
int count)
Appends the specified integer to this sequence
multiple times.
|
void |
fill(int start,
int length,
int value)
Sets the tokens in the specified subsequence to the given integer value.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
BigDecimal |
getBigDecimal(int i)
Gets the value of the specified token as
a
BigDecimal . |
double |
getDouble(int i)
Gets the value of the specified token as
a
double . |
float |
getFloat(int i)
Gets the value of the specified token as
a
float . |
int |
getInt(int i)
Gets the value of the specified token as
an
int . |
long |
getLong(int i)
Get the value of the specified token as
a
long . |
IntValued |
getToken(int index)
Gets the value at the specified position.
|
IntSettable |
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,
BigDecimal[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
BigDecimal objects. |
void |
getValues(int index,
double[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
double s. |
void |
getValues(int index,
float[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
float s. |
void |
getValues(int index,
int[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
int s. |
void |
getValues(int index,
long[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
long s. |
boolean |
isZero(int index)
Indicates whether the specified token has a zero value.
|
IntValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
setInt(int index,
int value)
Sets the token at the specified position to the given integer 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,
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.
|
int[] |
toArray()
Gets the list as an array.
|
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
isNull
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
ensureCanonical, getModificationCount
appendNull, appendNull, appendZero, appendZero, reset
append, append, append, append
public IntTokenList(int capacity)
capacity
- the initial capacity.public ScalarTokenType getType()
ScalarTokenSequence
getType
in interface ScalarTokenSequence
getType
in interface ScalarTyped
getType
in interface TokenTyped
public BigDecimal getBigDecimal(int i)
NumericTokenSequence
BigDecimal
.getBigDecimal
in interface NumericTokenSequence
i
- the position of the token in the sequencenull
is returned.public double getDouble(int i)
DoubleTokenSequence
double
.getDouble
in interface DoubleTokenSequence
i
- the position of the token in the sequenceDouble.NaN
is returned.public float getFloat(int i)
FloatTokenSequence
float
.getFloat
in interface FloatTokenSequence
i
- the position of the token in the sequenceFloat.NaN
is returned.public long getLong(int i)
LongTokenSequence
long
.getLong
in interface LongTokenSequence
i
- the position of the token in the sequence0
is returned.public int getInt(int i)
IntTokenSequence
int
.getInt
in interface IntTokenSequence
i
- the position of the token in the sequence0
is returned.public IntValued getToken(int index)
TokenSequence
getToken
in interface DoubleTokenSequence
getToken
in interface FloatTokenSequence
getToken
in interface IntTokenSequence
getToken
in interface LongTokenSequence
getToken
in interface NumericTokenSequence
getToken
in interface ScalarTokenSequence
getToken
in interface TokenSequence
index
- the index of the tokenpublic IntSettable getTokenSetter(int index)
MutableTokenSequence
getTokenSetter
in interface MutableTokenSequence
getTokenSetter
in interface MutableIntTokenSequence
getTokenSetter
in interface MutableScalarTokenSequence
index
- the positionpublic void getValues(int index, int[] values, boolean[] nullFlags, int offset, int length)
IntTokenSequence
int
s.getValues
in interface IntTokenSequence
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 int[] toArray()
public void getValues(int index, long[] values, boolean[] nullFlags, int offset, int length)
LongTokenSequence
long
s.getValues
in interface LongTokenSequence
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 getValues(int index, float[] values, boolean[] nullFlags, int offset, int length)
FloatTokenSequence
float
s.getValues
in interface FloatTokenSequence
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 getValues(int index, double[] values, boolean[] nullFlags, int offset, int length)
DoubleTokenSequence
double
s.getValues
in interface DoubleTokenSequence
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 getValues(int index, BigDecimal[] values, boolean[] nullFlags, int offset, int length)
NumericTokenSequence
BigDecimal
objects.getValues
in interface NumericTokenSequence
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 setInt(int index, int value)
setInt
in interface MutableIntTokenSequence
index
- the position of the token in the arrayvalue
- the integer value to which to set the token.public void fill(int start, int length, int value)
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencevalue
- the integer 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 append(int value)
MutableIntTokenSequence
append
in interface MutableIntTokenSequence
value
- the value to append.public void append(int value, int count)
MutableIntTokenSequence
append
in interface MutableIntTokenSequence
value
- the value to append.count
- the number of copies to append.public IntValuedIterator newValueIterator()
TokenSequence
newValueIterator
in interface DoubleTokenSequence
newValueIterator
in interface FloatTokenSequence
newValueIterator
in interface IntTokenSequence
newValueIterator
in interface LongTokenSequence
newValueIterator
in interface NumericTokenSequence
newValueIterator
in interface ScalarTokenSequence
newValueIterator
in interface TokenSequence
Copyright © 2024 Actian Corporation. All rights reserved.