Class InstantList

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<Instant>
org.apache.sis.internal.feature.InstantList
All Implemented Interfaces:
Iterable<Instant>, Collection<Instant>, List<Instant>, CheckedContainer<Instant>

final class InstantList extends AbstractList<Instant> implements CheckedContainer<Instant>
Unmodifiable lists of instants backed by a compressed vector.
Since:
0.8
Version:
1.1
  • Field Details

    • times

      private final Vector times
      The times in milliseconds since the epoch.
  • Constructor Details

    • InstantList

      InstantList(Vector times)
      Creates a new list for the given times.
  • Method Details

    • vectorize

      static Vector vectorize(long[] millis)
      Creates a vector for the given times.
      Parameters:
      millis - times in milliseconds since the epoch.
    • getElementType

      public Class<Instant> getElementType()
      Returns the kind of elements in this list.
      Specified by:
      getElementType in interface CheckedContainer<Instant>
      Returns:
      the element type.
    • size

      public int size()
      Returns the number of instants in this list.
      Specified by:
      size in interface Collection<Instant>
      Specified by:
      size in interface List<Instant>
      Specified by:
      size in class AbstractCollection<Instant>
      Returns:
      number of instants in this list.
    • get

      public Instant get(int index)
      Returns the instant at the given index.
      Specified by:
      get in interface List<Instant>
      Specified by:
      get in class AbstractList<Instant>
      Parameters:
      index - index of the desired extent element.
      Returns:
      instant at the given index.