public final class MoneyTokenList extends AbstractScalarTokenSequence implements MutableMoneyTokenSequence
MutableMoneyTokenSequence.TokenTypeConstant.MONEY| Constructor and Description |
|---|
MoneyTokenList(int capacity)
Create an empty array
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(long value)
Appends the specified long to this sequence.
|
void |
append(long value,
int count)
Appends the specified long to this sequence
multiple times.
|
void |
fill(int start,
int length,
long value)
Sets the tokens in the specified subsequence to the given money 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. |
long |
getCents(int i)
Get the value of the specified token as
a
long representing cents. |
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. |
MoneyValued |
getToken(int index)
Gets the value at the specified position.
|
MoneySettable |
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
doubles. |
void |
getValues(int index,
float[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
floats. |
void |
getValues(int index,
long[] values,
boolean[] nullFlags,
int offset,
int length)
Gets the values and null indicators for a range of tokens as
longs. |
boolean |
isZero(int index)
Indicates whether the specified token has a zero value.
|
MoneyValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
setCents(int index,
long value)
Sets the token at the specified position to the given money 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.
|
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, waitisNullcompareElement, compareElements, getElementComparator, hashCode, isNull, size, toStringensureCanonical, getModificationCountappendNull, appendNull, appendZero, appendZero, resetappend, append, append, appendpublic MoneyTokenList(int capacity)
capacity - the initial capacity.public ScalarTokenType getType()
ScalarTokenSequencegetType in interface ScalarTokenSequencegetType in interface ScalarTypedgetType in interface TokenTypedpublic BigDecimal getBigDecimal(int i)
NumericTokenSequenceBigDecimal.getBigDecimal in interface NumericTokenSequencei - the position of the token in the sequencenull
is returned.public double getDouble(int i)
DoubleTokenSequencedouble.getDouble in interface DoubleTokenSequencei - the position of the token in the sequenceDouble.NaN
is returned.public float getFloat(int i)
FloatTokenSequencefloat.getFloat in interface FloatTokenSequencei - the position of the token in the sequenceFloat.NaN
is returned.public long getCents(int i)
MoneyTokenSequencelong representing cents.getCents in interface MoneyTokenSequencei - the position of the token in the sequence0
is returned.public MoneyValued getToken(int index)
TokenSequencegetToken in interface DoubleTokenSequencegetToken in interface FloatTokenSequencegetToken in interface MoneyTokenSequencegetToken in interface NumericTokenSequencegetToken in interface ScalarTokenSequencegetToken in interface TokenSequenceindex - the index of the tokenpublic MoneySettable getTokenSetter(int index)
MutableTokenSequencegetTokenSetter in interface MutableTokenSequencegetTokenSetter in interface MutableMoneyTokenSequencegetTokenSetter in interface MutableScalarTokenSequenceindex - the positionpublic void getValues(int index,
long[] values,
boolean[] nullFlags,
int offset,
int length)
MoneyTokenSequencelongs.getValues in interface MoneyTokenSequenceindex - 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)
FloatTokenSequencefloats.getValues in interface FloatTokenSequenceindex - 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)
DoubleTokenSequencedoubles.getValues in interface DoubleTokenSequenceindex - 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)
NumericTokenSequenceBigDecimal objects.getValues in interface NumericTokenSequenceindex - 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 final boolean isZero(int index)
ScalarTokenSequenceisZero in interface ScalarTokenSequenceindex - the index of the tokentrue if the element is zero,
false otherwisepublic void setCents(int index,
long value)
setCents in interface MutableMoneyTokenSequenceindex - the position of the token in the arrayvalue - the cents value to which to set the token.public void fill(int start,
int length,
long value)
start - the starting index of the subsequence in the arraylength - the length of the subsequencevalue - the cents value to which to set the tokenspublic 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(long value)
MutableMoneyTokenSequenceappend in interface MutableMoneyTokenSequencevalue - the value to append.public void append(long value,
int count)
MutableMoneyTokenSequenceappend in interface MutableMoneyTokenSequencevalue - the value to append.count - the number of copies to append.public MoneyValuedIterator newValueIterator()
TokenSequencenewValueIterator in interface DoubleTokenSequencenewValueIterator in interface FloatTokenSequencenewValueIterator in interface MoneyTokenSequencenewValueIterator in interface NumericTokenSequencenewValueIterator in interface ScalarTokenSequencenewValueIterator in interface TokenSequenceCopyright © 2020 Actian Corporation. All rights reserved.