java.lang.Object
com.pervasive.datarush.sequences.scalar.AbstractScalarTokenSequence
com.pervasive.datarush.sequences.scalar.TimestampTokenList
- All Implemented Interfaces:
MutableTokenSequence,MutableScalarTokenSequence,MutableTimestampTokenSequence,ScalarTokenAppendable,ScalarTokenSequence,TimestampTokenSequence,TokenAppendable,TokenSequence,ScalarTyped,TokenTyped
public final class TimestampTokenList
extends AbstractScalarTokenSequence
implements MutableTimestampTokenSequence
Primary implementation of
MutableTimestampTokenSequence.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimestampTokenList(int capacity) Create a new array of timestamp tokens with the specified number of elements. -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends the specified timestamp to this sequence.voidAppends the specified timestamp to this sequence multiple times.voidappendEpochTime(long epochSeconds, int subsecondNanos, int offsetSeconds) Appends the timestamp specified in epoch time to this sequence.voidappendEpochTime(long epochSeconds, int subsecondNanos, int offsetSeconds, int count) Appends the timestamp specified in epoch time to this sequence multiple times.voidfillEpochSeconds(int start, int length, long seconds, int nanos, int offsetSeconds) Sets the tokens in the specified subsequence to a timestamp value specified as time since Java epoch (January 1, 1970 00:00:00 GMT) with time zone and daylight saving time offset.voidfillTimestamp(int start, int length, Timestamp value) Sets the tokens in the specified subsequence to a timestamp value specified as ajava.sql.Timestampobject, relative to the default time zone.voidfillTimestamp(int start, int length, Timestamp value, ZoneId zoneId) Sets the tokens in the specified subsequence to a timestamp value specified as ajava.sql.Timestampobject, relative to the given time zone.voidfillValue(int start, int length, TokenValued value) Sets the tokens in the specified subsequence to the given value.longgetEpochSeconds(int i) Gets the value of the specified token as the number of seconds elapsed since January 1, 1970 00:00:00 GMT.intgetOffsetSeconds(int i) Gets the time zone plus daylight savings time offset (in seconds) of the timestamp value of the specified token.intgetSubsecondNanos(int i) Gets the subsecond portion (in nanoseconds) of the timestamp value of the specified token.getTimestamp(int i) Gets the value of the specified token as a timestamp.getToken(int index) Gets the value at the specified position.getTokenSetter(int index) Returns a mutator for the given index.getType()Gets the data type of the tokens in the sequence.voidgetValues(int index, long[] secValues, int[] nanoValues, int[] offsetValues, 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.Creates an iterator over the non-null values of this sequence.voidsetEpochSeconds(int index, long seconds, int nanos, int offsetSeconds) Sets the token at the specified position to a timestamp value specified as time since Java epoch (January 1, 1970 00:00:00 GMT) with time zone and daylight saving time offset.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.voidsetTimestamp(int index, Timestamp value) Sets the token at the specified position to a timestamp value specified as ajava.sql.Timestampobject, relative to the default time zone.voidsetTimestamp(int index, Timestamp value, ZoneId zoneId) Sets the token at the specified position to a timestamp value specified as ajava.sql.Timestampobject, relative to the given time zone.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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pervasive.datarush.sequences.scalar.MutableScalarTokenSequence
ensureCanonical, getModificationCountMethods inherited from interface com.pervasive.datarush.sequences.MutableTokenSequence
appendNull, appendNull, appendZero, appendZero, resetMethods inherited from interface com.pervasive.datarush.sequences.scalar.ScalarTokenSequence
isNullMethods inherited from interface com.pervasive.datarush.sequences.TokenAppendable
append, append, append, appendMethods inherited from interface com.pervasive.datarush.sequences.TokenSequence
compareElement, compareElements, getElementComparator, hashCode, isNull, size, toString
-
Constructor Details
-
TimestampTokenList
public TimestampTokenList(int capacity) Create a new array of timestamp tokens with the specified number of elements. All elements in the array will initially be null valued.- Parameters:
capacity- the number of timestamp tokens in the array
-
-
Method Details
-
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
-
getTimestamp
Description copied from interface:TimestampTokenSequenceGets the value of the specified token as a timestamp.- Specified by:
getTimestampin interfaceTimestampTokenSequence- Parameters:
i- the position of the token in the sequence- Returns:
- the value of the token. If the
token is null valued,
nullis returned.
-
getEpochSeconds
public long getEpochSeconds(int i) Description copied from interface:TimestampTokenSequenceGets the value of the specified token as the number of seconds elapsed since January 1, 1970 00:00:00 GMT.- Specified by:
getEpochSecondsin interfaceTimestampTokenSequence- Parameters:
i- the position of the token in the sequence- Returns:
- the value of the token. If the
token is null valued,
0is returned.
-
getSubsecondNanos
public int getSubsecondNanos(int i) Description copied from interface:TimestampTokenSequenceGets the subsecond portion (in nanoseconds) of the timestamp value of the specified token.- Specified by:
getSubsecondNanosin interfaceTimestampTokenSequence- Parameters:
i- the position of the token in the sequence- Returns:
- the subsecond portion of the value in nanoseconds.
If the token is null valued,
0is returned.
-
getOffsetSeconds
public int getOffsetSeconds(int i) Description copied from interface:TimestampTokenSequenceGets the time zone plus daylight savings time offset (in seconds) of the timestamp value of the specified token.- Specified by:
getOffsetSecondsin interfaceTimestampTokenSequence- Parameters:
i- the position of the token in the sequence- Returns:
- the time zone plus daylight savings time offset in seconds.
If the token is null valued,
0is returned.
-
getToken
Description copied from interface:TokenSequenceGets the value at the specified position.- Specified by:
getTokenin interfaceScalarTokenSequence- Specified by:
getTokenin interfaceTimestampTokenSequence- Specified by:
getTokenin interfaceTokenSequence- Parameters:
index- the index of the token- Returns:
- the value
-
getTokenSetter
Description copied from interface:MutableTokenSequenceReturns a mutator for the given index.- Specified by:
getTokenSetterin interfaceMutableScalarTokenSequence- Specified by:
getTokenSetterin interfaceMutableTimestampTokenSequence- Specified by:
getTokenSetterin interfaceMutableTokenSequence- Parameters:
index- the position- Returns:
- a mutator for the given index.
-
getValues
public void getValues(int index, long[] secValues, int[] nanoValues, int[] offsetValues, boolean[] nullFlags, int offset, int length) Description copied from interface:TimestampTokenSequenceGets the values and null indicators for a range of tokens.- Specified by:
getValuesin interfaceTimestampTokenSequence- Parameters:
index- the starting index of the rangesecValues- an array into which to place the epoch second values of elementsnanoValues- an array into which to place the subsecond values of elementsoffsetValues- an array into which to place the offset seconds values of elementsnullFlags- 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
-
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 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
-
setTimestamp
Sets the token at the specified position to a timestamp value specified as ajava.sql.Timestampobject, relative to the default time zone. The time zone id returned byZoneId.systemDefault()is used.- Parameters:
index- the position of the token in the arrayvalue- the timestamp value to which to set the token, expressed as a point in time relative to the default time zone. Passingnullis equivalent tosetNull(index).
-
setTimestamp
Sets the token at the specified position to a timestamp value specified as ajava.sql.Timestampobject, relative to the given time zone.- Parameters:
index- the position of the token in the arrayvalue- the timestamp value to which to set the token, expressed as a point in time relative to the given time zone. Passingnullis equivalent tosetNull(index).zoneId- the time zone id in which the timestamp should be interpreted
-
fillTimestamp
Sets the tokens in the specified subsequence to a timestamp value specified as ajava.sql.Timestampobject, relative to the default time zone. The time zone returned byZoneId.systemDefault()is used.- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequencevalue- the timestamp value to which to set the tokens, expressed as a point in time relative to the default time zone. Passingnullis equivalent tosetNull(start, length).
-
fillTimestamp
Sets the tokens in the specified subsequence to a timestamp value specified as ajava.sql.Timestampobject, relative to the given time zone.- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequencevalue- the timestamp value to which to set the tokens, expressed as a point in time relative to the given time zone. Passingnullis equivalent tosetNull(start, length).zoneId- the time zone id in which the timestamp should be interpreted
-
setEpochSeconds
public void setEpochSeconds(int index, long seconds, int nanos, int offsetSeconds) Sets the token at the specified position to a timestamp value specified as time since Java epoch (January 1, 1970 00:00:00 GMT) with time zone and daylight saving time offset.- Specified by:
setEpochSecondsin interfaceMutableTimestampTokenSequence- Parameters:
index- the position of the token in the arrayseconds- number of seconds since Java epochnanos- fractional portion of epoch time in nanosecondsoffsetSeconds- time zone and daylight saving time offset, in seconds
-
fillEpochSeconds
public void fillEpochSeconds(int start, int length, long seconds, int nanos, int offsetSeconds) Sets the tokens in the specified subsequence to a timestamp value specified as time since Java epoch (January 1, 1970 00:00:00 GMT) with time zone and daylight saving time offset.- Parameters:
start- the starting index of the subsequence in the arraylength- the length of the subsequenceseconds- number of seconds since Java epochnanos- fractional portion of epoch time in nanosecondsoffsetSeconds- time zone and daylight saving time offset, in seconds
-
setValue
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
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
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
-
append
Description copied from interface:MutableTimestampTokenSequenceAppends the specified timestamp to this sequence.- Specified by:
appendin interfaceMutableTimestampTokenSequence- Parameters:
value- the value to append. Ifnull, this is equivalent toappendNull().
-
append
Description copied from interface:MutableTimestampTokenSequenceAppends the specified timestamp to this sequence multiple times.- Specified by:
appendin interfaceMutableTimestampTokenSequence- Parameters:
value- the value to append. Ifnull, this is equivalent toappendNull().count- the number of copies to append.
-
appendEpochTime
public void appendEpochTime(long epochSeconds, int subsecondNanos, int offsetSeconds) Description copied from interface:MutableTimestampTokenSequenceAppends the timestamp specified in epoch time to this sequence.- Specified by:
appendEpochTimein interfaceMutableTimestampTokenSequence- Parameters:
epochSeconds- the number of seconds elapsed since January 1, 1970 00:00:00 GMT.subsecondNanos- the subsecond portion of the timestamp in nanoseconds.offsetSeconds- the offset in seconds, including both time zone and daylight savings adjustments, from GMT.
-
appendEpochTime
public void appendEpochTime(long epochSeconds, int subsecondNanos, int offsetSeconds, int count) Description copied from interface:MutableTimestampTokenSequenceAppends the timestamp specified in epoch time to this sequence multiple times.- Specified by:
appendEpochTimein interfaceMutableTimestampTokenSequence- Parameters:
epochSeconds- the number of seconds elapsed since January 1, 1970 00:00:00 GMT.subsecondNanos- the subsecond portion of the timestamp in nanoseconds.offsetSeconds- the offset in seconds, including both time zone and daylight savings adjustments, from GMT.count- the number of copies to append.
-
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 interfaceTimestampTokenSequence- Specified by:
newValueIteratorin interfaceTokenSequence- Returns:
- an newly-created iterator over the non-null values of this sequence.
-