public final class DurationTokenList extends AbstractScalarTokenSequence implements MutableDurationTokenSequence
MutableDurationTokenSequence.TokenTypeConstant.DURATION| Constructor and Description |
|---|
DurationTokenList(int initialCapacity)
Create an empty array
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(Duration value)
Appends the specified duration to this sequence.
|
void |
append(Duration value,
int count)
Appends the specified duration to this sequence
multiple times.
|
void |
appendDuration(long seconds,
int subsecondNanos)
Appends the duration specified in seconds to this sequence.
|
void |
appendDuration(long seconds,
int subsecondNanos,
int count)
Appends the duration specified in seconds to this sequence
multiple times.
|
void |
fillDurations(int start,
int length,
long seconds,
int nanos)
Sets the tokens in the specified subsequence to a duration value specified
as seconds and nanoseconds.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
Duration |
getDuration(int index)
Gets the value of the specified token as
a duration.
|
long |
getSeconds(int index)
Gets the value of the specified token as the number of seconds
in the duration.
|
int |
getSubsecondNanos(int index)
Gets the subsecond portion (in nanoseconds) of the duration
value of the specified token.
|
DurationValued |
getToken(int index)
Gets the value at the specified position.
|
DurationSettable |
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,
long[] secValues,
int[] nanoValues,
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.
|
DurationValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
set(int index,
Duration value)
Sets the token at the specified position to the given value.
|
void |
setDuration(int index,
long seconds,
int subsecondNanos)
Sets the token at the specified position to the given 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, waitensureCanonical, getModificationCountisNullappendNull, appendNull, appendZero, appendZero, resetcompareElement, compareElements, getElementComparator, hashCode, isNull, size, toStringappend, append, append, appendpublic DurationTokenList(int initialCapacity)
initialCapacity - the initial capacity.public ScalarTokenType getType()
ScalarTokenSequencegetType in interface ScalarTokenSequencegetType in interface ScalarTypedgetType in interface TokenTypedpublic DurationValued getToken(int index)
TokenSequencegetToken in interface DurationTokenSequencegetToken in interface ScalarTokenSequencegetToken in interface TokenSequenceindex - the index of the tokenpublic Duration getDuration(int index)
DurationTokenSequencegetDuration in interface DurationTokenSequenceindex - the position of the token in the sequencenull is returned.public long getSeconds(int index)
DurationTokenSequencegetSeconds in interface DurationTokenSequenceindex - the position of the token in the sequence0 is returned.public int getSubsecondNanos(int index)
DurationTokenSequencegetSubsecondNanos in interface DurationTokenSequenceindex - the position of the token in the sequence0 is returned.public void getValues(int index,
long[] secValues,
int[] nanoValues,
boolean[] nullFlags,
int offset,
int length)
DurationTokenSequencegetValues in interface DurationTokenSequenceindex - the starting index of the rangesecValues - an array into which to place the second values
of elementsnanoValues - an array into which to place the subsecond values
of elementsnullFlags - 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 DurationValuedIterator newValueIterator()
TokenSequencenewValueIterator in interface DurationTokenSequencenewValueIterator in interface ScalarTokenSequencenewValueIterator in interface TokenSequencepublic boolean isZero(int index)
ScalarTokenSequenceisZero in interface ScalarTokenSequenceindex - the index of the tokentrue if the element is zero,
false otherwisepublic 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 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 fillDurations(int start,
int length,
long seconds,
int nanos)
start - the starting index of the subsequence in the arraylength - the length of the subsequenceseconds - number of seconds in durationnanos - fractional portion of second in durationpublic 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(Duration value)
MutableDurationTokenSequenceappend in interface MutableDurationTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull().public void appendDuration(long seconds,
int subsecondNanos)
MutableDurationTokenSequenceappendDuration in interface MutableDurationTokenSequenceseconds - the number of seconds in the duration.subsecondNanos - the subsecond portion of the duration
in nanoseconds.public void append(Duration value, int count)
MutableDurationTokenSequenceappend in interface MutableDurationTokenSequencevalue - the value to append. If null,
this is equivalent to appendNull().count - the number of copies to append.public void appendDuration(long seconds,
int subsecondNanos,
int count)
MutableDurationTokenSequenceappendDuration in interface MutableDurationTokenSequenceseconds - the number of seconds in the duration.subsecondNanos - the subsecond portion of the duration
in nanoseconds.count - the number of copies to append.public void set(int index,
Duration value)
MutableDurationTokenSequenceset in interface MutableDurationTokenSequenceindex - the position to modify.value - the duration to which to set the token.public void setDuration(int index,
long seconds,
int subsecondNanos)
MutableDurationTokenSequencesetDuration in interface MutableDurationTokenSequenceindex - the position to modify.seconds - the number of seconds in the duration.subsecondNanos - the subsecond portion of the duration
in nanoseconds.public DurationSettable getTokenSetter(int index)
MutableTokenSequencegetTokenSetter in interface MutableTokenSequencegetTokenSetter in interface MutableDurationTokenSequencegetTokenSetter in interface MutableScalarTokenSequenceindex - the positionCopyright © 2024 Actian Corporation. All rights reserved.