T - type of the objectpublic class ObjectDoubleTopN<T> extends AbstractTopN<Tuple2od<T>>
capacity, size| Constructor and Description |
|---|
ObjectDoubleTopN(int capacity)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T object,
double value)
Tries to add an object-double pair to the heap.
|
protected int |
compare(int i,
int j)
Compares the i-th element of the heap with the j-th element in the heap.
|
protected int |
compare(int i,
Tuple2od<T> e)
Compares the i-th element of the heap with the element
|
protected Tuple2od<T> |
get(int i)
Returns the i-th element in the heap.
|
protected void |
set(int i,
Tuple2od<T> e)
Sets the element in the i-th position of the heap.
|
protected void |
swap(int i,
int j)
Swaps the elements in the i-th and j-th element in the heap.
|
add, iterator, peek, reverseIterator, reverseStream, size, sortaddAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCode, parallelStream, removeIf, spliterator, streampublic ObjectDoubleTopN(int capacity)
capacity - maximum capacity of the heappublic boolean add(T object, double value)
object - object to be addedvalue - double to be addedprotected Tuple2od<T> get(int i)
AbstractTopNget in class AbstractTopN<Tuple2od<T>>i - index of the elementprotected void set(int i,
Tuple2od<T> e)
AbstractTopNset in class AbstractTopN<Tuple2od<T>>i - indexe - elementprotected int compare(int i,
Tuple2od<T> e)
AbstractTopNcompare in class AbstractTopN<Tuple2od<T>>i - indexe - elementprotected int compare(int i,
int j)
AbstractTopNcompare in class AbstractTopN<Tuple2od<T>>i - indexj - indexprotected void swap(int i,
int j)
AbstractTopNswap in class AbstractTopN<Tuple2od<T>>i - indexj - indexCopyright © 2016. All rights reserved.