Class SortedDoubleVector
java.lang.Object
com.espertech.esper.common.internal.collection.SortedDoubleVector
Sorted, reference-counting set based on an ArrayList implementation that it being kept sorted.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.Returns underlying ArrayList, for testing purposes only.static SortedDoubleVector
readPoints
(DataInput input) NOTE: Code-generation-invoked method, method name and parameter order mattersvoid
remove
(double value) Remove a value from the collection.int
size()
Returns the number of items in the collection.static void
writePoints
(DataOutput output, SortedDoubleVector vector) NOTE: Code-generation-invoked method, method name and parameter order matters
-
Field Details
-
EPTYPE
-
-
Constructor Details
-
SortedDoubleVector
public SortedDoubleVector()Constructor. -
SortedDoubleVector
-
-
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
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
NOTE: Code-generation-invoked method, method name and parameter order matters- Parameters:
output
- outvector
- points- Throws:
IOException
- io error
-
readPoints
NOTE: Code-generation-invoked method, method name and parameter order matters- Parameters:
input
- input- Returns:
- points
- Throws:
IOException
- io error
-