public final class TimeTokenList extends AbstractScalarTokenSequence implements MutableTimeTokenSequence
MutableTimeTokenSequence
.TokenTypeConstant.TIME
Constructor and Description |
---|
TimeTokenList(int initialCapacity)
Create an empty array
|
Modifier and Type | Method and Description |
---|---|
void |
append(TimeOfDay time)
Appends the specified time of day to this sequence.
|
void |
append(TimeOfDay time,
int count)
Appends the specified time of day to this sequence.
|
void |
appendDayMillis(int dayMillis)
Appends the time value specified as the number of milliseconds
elapsed since midnight to this sequence.
|
void |
appendDayMillis(int dayMillis,
int count)
Appends the time value specified as the number of milliseconds
elapsed since midnight to this sequence multiple times.
|
void |
fillDayMillis(int start,
int length,
int millis)
Sets the tokens in the specified subsequence to a time value
specified as the number of milliseconds elapsed since midnight.
|
void |
fillTimeOfDay(int start,
int length,
TimeOfDay value)
Sets the tokens in the specified subsequence to the
specified calendar date.
|
void |
fillValue(int start,
int length,
TokenValued value)
Sets the tokens in the specified subsequence to the given value.
|
int |
getDayMillis(int index)
Get the value of the specified token as the number
of milliseconds elapsed since midnight.
|
TimeOfDay |
getTimeOfDay(int index)
Gets the value of the specified token as
a time of day.
|
TimeValued |
getToken(int index)
Gets the value at the specified position.
|
TimeSettable |
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,
int[] 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.
|
TimeValuedIterator |
newValueIterator()
Creates an iterator over the non-null values of this sequence.
|
void |
setDayMillis(int index,
int millis)
Sets the token at the specified position to a time value specified
as the number of milliseconds elapsed since midnight.
|
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 |
setTimeOfDay(int index,
TimeOfDay value)
Sets the token at the specified position to the specified
time of day.
|
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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
ensureCanonical, getModificationCount
isNull
appendNull, appendNull, appendZero, appendZero, reset
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
append, append, append, append
public TimeTokenList(int initialCapacity)
initialCapacity
- the initial capacity.public ScalarTokenType getType()
ScalarTokenSequence
getType
in interface ScalarTokenSequence
getType
in interface ScalarTyped
getType
in interface TokenTyped
public int getDayMillis(int index)
TimeTokenSequence
getDayMillis
in interface TimeTokenSequence
index
- the index of the token0
is returned.public TimeOfDay getTimeOfDay(int index)
TimeTokenSequence
getTimeOfDay
in interface TimeTokenSequence
index
- the position of the token in the sequencenull
is returned.public TimeValued getToken(int index)
TokenSequence
getToken
in interface ScalarTokenSequence
getToken
in interface TimeTokenSequence
getToken
in interface TokenSequence
index
- the index of the tokenpublic TimeSettable getTokenSetter(int index)
MutableTokenSequence
getTokenSetter
in interface MutableTokenSequence
getTokenSetter
in interface MutableScalarTokenSequence
getTokenSetter
in interface MutableTimeTokenSequence
index
- the positionpublic void getValues(int index, int[] values, boolean[] nullFlags, int offset, int length)
TimeTokenSequence
getValues
in interface TimeTokenSequence
index
- the starting index of the rangevalues
- an array into which to place element values,
represented as milliseconds since midnightnullFlags
- 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 get#getEpochDays(int)
public 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 setDayMillis(int index, int millis)
MutableTimeTokenSequence
setDayMillis
in interface MutableTimeTokenSequence
public void fillDayMillis(int start, int length, int millis)
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencemillis
- time value to which to set the token, expressed as the
number of milliseconds since midnightpublic void setTimeOfDay(int index, TimeOfDay value)
index
- the position of the token in the arrayvalue
- the calendar date to which to set the token. Passing
null
is equivalent to calling setNull(index
}.public void fillTimeOfDay(int start, int length, TimeOfDay value)
start
- the starting index of the subsequence in the arraylength
- the length of the subsequencevalue
- the calendar date to which to set the tokens. Passing
null
is equivalent to calling setNull(start, length
}.public 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 appendDayMillis(int dayMillis)
MutableTimeTokenSequence
appendDayMillis
in interface MutableTimeTokenSequence
dayMillis
- time value to which to set the token, expressed as the
number of milliseconds elapsed since midnightpublic void appendDayMillis(int dayMillis, int count)
MutableTimeTokenSequence
appendDayMillis
in interface MutableTimeTokenSequence
dayMillis
- the value to append.count
- the number of copies to append.public void append(TimeOfDay time)
MutableTimeTokenSequence
append
in interface MutableTimeTokenSequence
time
- the value to append.public void append(TimeOfDay time, int count)
MutableTimeTokenSequence
append
in interface MutableTimeTokenSequence
time
- the value to append.count
- the number of copies to append.public TimeValuedIterator newValueIterator()
TokenSequence
newValueIterator
in interface ScalarTokenSequence
newValueIterator
in interface TimeTokenSequence
newValueIterator
in interface TokenSequence
Copyright © 2016 Actian Corporation. All rights reserved.