Class SortedDoubleVector

java.lang.Object
com.espertech.esper.common.internal.collection.SortedDoubleVector

public class SortedDoubleVector extends Object
Sorted, reference-counting set based on an ArrayList implementation that it being kept sorted.
  • Field Details

  • Constructor Details

    • SortedDoubleVector

      public SortedDoubleVector()
      Constructor.
    • SortedDoubleVector

      public SortedDoubleVector(ArrayList<Double> values)
  • Method Details

    • clear

      public void clear()
      Clear out the collection.
    • size

      public int size()
      Returns the number of items in the collection.
      Returns:
      size
    • getValue

      public double getValue(int index)
      Returns the value at a given index.
      Parameters:
      index - for which to return value for
      Returns:
      value at index
    • add

      public void add(double value)
      Add a value to the collection.
      Parameters:
      value - is the double-type value to add
    • remove

      public void remove(double value)
      Remove a value from the collection.
      Parameters:
      value - to remove
    • getValues

      public ArrayList<Double> getValues()
      Returns underlying ArrayList, for testing purposes only.
      Returns:
      sorted double values list
    • findInsertIndex

      protected int findInsertIndex(double value)
      Returns the index into which to insert to. Proptected access level for convenient testing.
      Parameters:
      value - to find insert index
      Returns:
      position to insert the value to, or -1 to indicate to add to the end.
    • writePoints

      public static void writePoints(DataOutput output, SortedDoubleVector vector) throws IOException
      NOTE: Code-generation-invoked method, method name and parameter order matters
      Parameters:
      output - out
      vector - points
      Throws:
      IOException - io error
    • readPoints

      public static SortedDoubleVector readPoints(DataInput input) throws IOException
      NOTE: Code-generation-invoked method, method name and parameter order matters
      Parameters:
      input - input
      Returns:
      points
      Throws:
      IOException - io error