Class SequenceVector

All Implemented Interfaces:
Serializable, Iterable<Number>, Collection<Number>, List<Number>, RandomAccess, SequencedCollection<Number>
Direct Known Subclasses:
SequenceVector.Doubles, SequenceVector.Longs

abstract class SequenceVector extends Vector implements Serializable
A vector which is a sequence of increasing or decreasing values. Values may be long or double types.
Since:
0.8
Version:
1.1
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • type

      final Class<? extends Number> type
      The type of values in the vector.
    • length

      final int length
      The length of this vector.
  • Constructor Details

    • SequenceVector

      SequenceVector(Class<? extends Number> type, int length)
      Creates a sequence of numbers of the given length.
  • Method Details

    • createTransform

      final Vector createTransform(double scale, double offset)
      Transforms the sequence. The result is always of Double type, regardless the type of elements in this vector.
      Overrides:
      createTransform in class Vector
    • getElementType

      public final Class<? extends Number> getElementType()
      Returns the type of elements.
      Specified by:
      getElementType in class Vector
      Returns:
      the type of elements in this vector.
      See Also:
    • size

      public final int size()
      Returns the vector size.
      Specified by:
      size in interface Collection<Number>
      Specified by:
      size in interface List<Number>
      Specified by:
      size in class Vector
      Returns:
      the number of elements in this vector.
    • isEmptyOrNaN

      public final boolean isEmptyOrNaN()
      Returns true if this vector is empty or contains only NaN values.
      Overrides:
      isEmptyOrNaN in class Vector
      Returns:
      whether this vector is empty or contains only NaN values.
    • set

      public final Number set(int index, Number value)
      Unsupported operation since this vector is not modifiable.
      Specified by:
      set in interface List<Number>
      Specified by:
      set in class Vector
      Parameters:
      index - the index in the [0 … size-1] range.
      value - the value to set at the given index.
      Returns:
      the value previously stored at the given index.
    • compress

      public final Vector compress(double tolerance)
      Returns this since Apache SIS cannot create a more compact vector than this SequenceVector.
      Overrides:
      compress in class Vector
      Parameters:
      tolerance - maximal difference allowed between original and compressed vectors (can be zero).
      Returns:
      a more compact vector with the same data than this vector, or this.
    • doubleValues

      public double[] doubleValues()
      Creates the sequence as a floating point array.
      Overrides:
      doubleValues in class Vector
      Returns:
      a copy of all floating point values in this vector.
      See Also:
    • floatValues

      public float[] floatValues()
      Creates the sequence as a floating point array.
      Overrides:
      floatValues in class Vector
      Returns:
      a copy of all floating point values in this vector.
      See Also: