Interface DurationTokenSequence

All Superinterfaces:
ScalarTokenSequence, ScalarTyped, TokenSequence, TokenTyped
All Known Subinterfaces:
MutableDurationTokenSequence
All Known Implementing Classes:
DurationTokenList, SparseDurationTokenList

public interface DurationTokenSequence extends ScalarTokenSequence
A TokenSequence containing duration valued data.
See Also:
  • TokenTypeConstant#DURATION
  • Method Details

    • getToken

      DurationValued getToken(int index)
      Description copied from interface: TokenSequence
      Gets the value at the specified position.
      Specified by:
      getToken in interface ScalarTokenSequence
      Specified by:
      getToken in interface TokenSequence
      Parameters:
      index - the index of the token
      Returns:
      the value
    • getDuration

      Duration getDuration(int index)
      Gets the value of the specified token as a duration.
      Parameters:
      index - the position of the token in the sequence
      Returns:
      the value of the token. If the token is null valued, null is returned.
    • getSeconds

      long getSeconds(int index)
      Gets the value of the specified token as the number of seconds in the duration.
      Parameters:
      index - the position of the token in the sequence
      Returns:
      the value of the token. If the token is null valued, 0 is returned.
    • getSubsecondNanos

      int getSubsecondNanos(int index)
      Gets the subsecond portion (in nanoseconds) of the duration value of the specified token.
      Parameters:
      index - the position of the token in the sequence
      Returns:
      the subsecond portion of the value in nanoseconds. If the token is null valued, 0 is returned.
    • getValues

      void getValues(int start, long[] secValues, int[] nanoValues, boolean[] nulls, int offset, int length)
      Gets the values and null indicators for a range of tokens.
      Parameters:
      start - the starting index of the range
      secValues - an array into which to place the second values of elements
      nanoValues - an array into which to place the subsecond values of elements
      nulls - an array into which to place null indicator values
      offset - 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
    • newValueIterator

      DurationValuedIterator newValueIterator()
      Description copied from interface: TokenSequence
      Creates 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:
      newValueIterator in interface ScalarTokenSequence
      Specified by:
      newValueIterator in interface TokenSequence
      Returns:
      an newly-created iterator over the non-null values of this sequence.