com.espertech.esper.collection
Class SortedDoubleVector

java.lang.Object
  extended by com.espertech.esper.collection.SortedDoubleVector

public class SortedDoubleVector
extends java.lang.Object

Sorted, reference-counting set based on an ArrayList implementation that it being kept sorted.


Constructor Summary
SortedDoubleVector()
          Constructor.
SortedDoubleVector(java.util.ArrayList<java.lang.Double> values)
           
 
Method Summary
 void add(double value)
          Add a value to the collection.
 void clear()
          Clear out the collection.
protected  int findInsertIndex(double value)
          Returns the index into which to insert to.
 double getValue(int index)
          Returns the value at a given index.
 java.util.ArrayList<java.lang.Double> getValues()
          Returns underlying ArrayList, for testing purposes only.
 void remove(double value)
          Remove a value from the collection.
 int size()
          Returns the number of items in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedDoubleVector

public SortedDoubleVector()
Constructor.


SortedDoubleVector

public SortedDoubleVector(java.util.ArrayList<java.lang.Double> values)
Method Detail

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
Throws:
java.lang.IllegalStateException - if the value has not been added

getValues

public java.util.ArrayList<java.lang.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.

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com