- java.lang.Object
-
- com.pervasive.datarush.sequences.scalar.AbstractScalarTokenSequence
-
- com.pervasive.datarush.sequences.scalar.TimeTokenList
-
- All Implemented Interfaces:
MutableTokenSequence,MutableScalarTokenSequence,MutableTimeTokenSequence,ScalarTokenAppendable,ScalarTokenSequence,TimeTokenSequence,TokenAppendable,TokenSequence,ScalarTyped,TokenTyped
public final class TimeTokenList extends AbstractScalarTokenSequence implements MutableTimeTokenSequence
Primary implementation ofMutableTimeTokenSequence.- See Also:
TokenTypeConstant.TIME
-
-
Constructor Summary
Constructors Constructor Description TimeTokenList(int initialCapacity)Create an empty array
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(TimeOfDay time)Appends the specified time of day to this sequence.voidappend(TimeOfDay time, int count)Appends the specified time of day to this sequence.voidappendDayMillis(int dayMillis)Appends the time value specified as the number of milliseconds elapsed since midnight to this sequence.voidappendDayMillis(int dayMillis, int count)Appends the time value specified as the number of milliseconds elapsed since midnight to this sequence multiple times.voidfillDayMillis(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.voidfillTimeOfDay(int start, int length, TimeOfDay value)Sets the tokens in the specified subsequence to the specified calendar date.voidfillValue(int start, int length, TokenValued value)Sets the tokens in the specified subsequence to the given value.intgetDayMillis(int index)Get the value of the specified token as the number of milliseconds elapsed since midnight.TimeOfDaygetTimeOfDay(int index)Gets the value of the specified token as a time of day.TimeValuedgetToken(int index)Gets the value at the specified position.TimeSettablegetTokenSetter(int index)Returns a mutator for the given index.ScalarTokenTypegetType()Gets the data type of the tokens in the sequence.voidgetValues(int index, int[] values, boolean[] nullFlags, int offset, int length)Gets the values and null indicators for a range of tokens.booleanisZero(int index)Indicates whether the specified token has a zero value.TimeValuedIteratornewValueIterator()Creates an iterator over the non-null values of this sequence.voidsetDayMillis(int index, int millis)Sets the token at the specified position to a time value specified as the number of milliseconds elapsed since midnight.voidsetNull(int index)Sets the token at the specified position to be null valued.voidsetNull(int start, int length)Sets the tokens in the specified subsequence to be null valued.voidsetTimeOfDay(int index, TimeOfDay value)Sets the token at the specified position to the specified time of day.voidsetValue(int index, TokenValued value)Sets the token at the specified position to the given value.voidsetValues(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.voidsetZero(int index)Sets the token at the specified position to be zero valued.voidsetZero(int start, int length)Sets the tokens in the specified subsequence to be zero valued.-
Methods inherited from class com.pervasive.datarush.sequences.scalar.AbstractScalarTokenSequence
append, append, append, append, appendNull, appendNull, appendZero, appendZero, capacity, compareElement, compareElements, ensureCanonical, getElementComparator, getModificationCount, hashCode, isNull, isNull, map, remaining, reset, size, toString, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.sequences.scalar.MutableScalarTokenSequence
ensureCanonical, getModificationCount
-
Methods inherited from interface com.pervasive.datarush.sequences.MutableTokenSequence
appendNull, appendNull, appendZero, appendZero, reset
-
Methods inherited from interface com.pervasive.datarush.sequences.scalar.ScalarTokenSequence
isNull
-
Methods inherited from interface com.pervasive.datarush.sequences.TokenAppendable
append, append, append, append
-
Methods inherited from interface com.pervasive.datarush.sequences.TokenSequence
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
-
-
-
-
Method Detail
-
getType
public ScalarTokenType getType()
Description copied from interface:ScalarTokenSequenceGets the data type of the tokens in the sequence.- Specified by:
getTypein interfaceScalarTokenSequence- Specified by:
getTypein interfaceScalarTyped- Specified by:
getTypein interfaceTokenTyped- Returns:
- the token data type
-
getDayMillis
public int getDayMillis(int index)
Description copied from interface:TimeTokenSequenceGet the value of the specified token as the number of milliseconds elapsed since midnight.- Specified by:
getDayMillisin interfaceTimeTokenSequence- Parameters:
index- the index of the token- Returns:
- the value of the element. If the
token is null valued,
0is returned.
-
getTimeOfDay
public TimeOfDay getTimeOfDay(int index)
Description copied from interface:TimeTokenSequenceGets the value of the specified token as a time of day.- Specified by:
getTimeOfDayin interfaceTimeTokenSequence- Parameters:
index- the position of the token in the sequence- Returns:
- the value of the token. If the
token is null valued,
nullis returned.
-
getToken
public TimeValued getToken(int index)
Description copied from interface:TokenSequenceGets the value at the specified position.- Specified by:
getTokenin interfaceScalarTokenSequence- Specified by:
getTokenin interfaceTimeTokenSequence- Specified by:
getTokenin interfaceTokenSequence- Parameters:
index- the index of the token- Returns:
- the value
-
getTokenSetter
public TimeSettable getTokenSetter(int index)
Description copied from interface:MutableTokenSequenceReturns a mutator for the given index.- Specified by:
getTokenSetterin interfaceMutableScalarTokenSequence- Specified by:
getTokenSetterin interfaceMutableTimeTokenSequence- Specified by:
getTokenSetterin interfaceMutableTokenSequence- Parameters:
index- the position- Returns:
- a mutator for the given index.
-
getValues
public void getValues(int index, int[] values, boolean[] nullFlags, int offset, int length)Description copied from interface:TimeTokenSequenceGets the values and null indicators for a range of tokens.- Specified by:
getValuesin interfaceTimeTokenSequence- Parameters:
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]andnulls[offset]will get the value and null indicator respectively of the token at positionstart, and so on.length- number of tokens to get- See Also:
#getEpochDays(int)
-
setNull
public void setNull(int index)
Description copied from interface:MutableTokenSequenceSets the token at the specified position to be null valued.- Specified by:
setNullin interfaceMutableTokenSequence- Parameters:
index- the position of the token in the array
-
setNull
public void setNull(int start, int length)Description copied from interface:MutableTokenSequenceSets the tokens in the specified subsequence to be null valued.- Specified by:
setNullin interfaceMutableTokenSequence- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequence
-
setZero
public void setZero(int index)
Description copied from interface:MutableTokenSequenceSets the token at the specified position to be zero valued.- Specified by:
setZeroin interfaceMutableTokenSequence- Parameters:
index- the position of the token in the array
-
setZero
public void setZero(int start, int length)Description copied from interface:MutableTokenSequenceSets the tokens in the specified subsequence to be zero valued.- Specified by:
setZeroin interfaceMutableTokenSequence- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequence
-
isZero
public final boolean isZero(int index)
Description copied from interface:ScalarTokenSequenceIndicates whether the specified token has a zero value.- Specified by:
isZeroin interfaceScalarTokenSequence- Parameters:
index- the index of the token- Returns:
trueif the element is zero,falseotherwise
-
setDayMillis
public void setDayMillis(int index, int millis)Description copied from interface:MutableTimeTokenSequenceSets the token at the specified position to a time value specified as the number of milliseconds elapsed since midnight.- Specified by:
setDayMillisin interfaceMutableTimeTokenSequence
-
fillDayMillis
public 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.- Parameters:
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 midnight
-
setTimeOfDay
public void setTimeOfDay(int index, TimeOfDay value)Sets the token at the specified position to the specified time of day.- Parameters:
index- the position of the token in the arrayvalue- the calendar date to which to set the token. Passingnullis equivalent to callingsetNull(index}.
-
fillTimeOfDay
public void fillTimeOfDay(int start, int length, TimeOfDay value)Sets the tokens in the specified subsequence to the specified calendar date.- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequencevalue- the calendar date to which to set the tokens. Passingnullis equivalent to callingsetNull(start, length}.
-
setValue
public void setValue(int index, TokenValued value)Description copied from interface:MutableTokenSequenceSets the token at the specified position to the given value.- Specified by:
setValuein interfaceMutableTokenSequence- Parameters:
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.
-
fillValue
public void fillValue(int start, int length, TokenValued value)Description copied from interface:MutableTokenSequenceSets the tokens in the specified subsequence to the given value.- Specified by:
fillValuein interfaceMutableTokenSequence- Parameters:
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 array
-
setValues
public void setValues(int start, TokenSequence values, int offset, int length)Description copied from interface:MutableTokenSequenceSets the tokens in the specified subsequence of the array to the corresponding values from a subsequence of the given source sequence.- Specified by:
setValuesin interfaceMutableTokenSequence- Parameters:
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 positionoffsetinvalueswill be assigned to the token at positionstart, and so on.length- the number of tokens to copy
-
appendDayMillis
public void appendDayMillis(int dayMillis)
Description copied from interface:MutableTimeTokenSequenceAppends the time value specified as the number of milliseconds elapsed since midnight to this sequence.- Specified by:
appendDayMillisin interfaceMutableTimeTokenSequence- Parameters:
dayMillis- time value to which to set the token, expressed as the number of milliseconds elapsed since midnight
-
appendDayMillis
public void appendDayMillis(int dayMillis, int count)Description copied from interface:MutableTimeTokenSequenceAppends the time value specified as the number of milliseconds elapsed since midnight to this sequence multiple times.- Specified by:
appendDayMillisin interfaceMutableTimeTokenSequence- Parameters:
dayMillis- the value to append.count- the number of copies to append.
-
append
public void append(TimeOfDay time)
Description copied from interface:MutableTimeTokenSequenceAppends the specified time of day to this sequence.- Specified by:
appendin interfaceMutableTimeTokenSequence- Parameters:
time- the value to append.
-
append
public void append(TimeOfDay time, int count)
Description copied from interface:MutableTimeTokenSequenceAppends the specified time of day to this sequence.- Specified by:
appendin interfaceMutableTimeTokenSequence- Parameters:
time- the value to append.count- the number of copies to append.
-
newValueIterator
public TimeValuedIterator newValueIterator()
Description copied from interface:TokenSequenceCreates an iterator over the non-null values of this sequence. The iterator will automatically be reset as modifications are made to the sequence.- Specified by:
newValueIteratorin interfaceScalarTokenSequence- Specified by:
newValueIteratorin interfaceTimeTokenSequence- Specified by:
newValueIteratorin interfaceTokenSequence- Returns:
- an newly-created iterator over the non-null values of this sequence.
-
-