public class IntDoubleTopN extends AbstractTopN<Tuple2id>
capacity, size| Constructor and Description |
|---|
IntDoubleTopN(int capacity)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int key,
double value)
Tries to add an integer-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,
Tuple2id e)
Compares the i-th element of the heap with the element
|
protected Tuple2id |
get(int i)
Returns the i-th element in the heap.
|
protected void |
set(int i,
Tuple2id 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 IntDoubleTopN(int capacity)
capacity - maximum capacity of the heappublic boolean add(int key,
double value)
key - integer to be addedvalue - double to be addedprotected Tuple2id get(int i)
AbstractTopNget in class AbstractTopN<Tuple2id>i - index of the elementprotected void set(int i,
Tuple2id e)
AbstractTopNset in class AbstractTopN<Tuple2id>i - indexe - elementprotected int compare(int i,
Tuple2id e)
AbstractTopNcompare in class AbstractTopN<Tuple2id>i - indexe - elementprotected int compare(int i,
int j)
AbstractTopNcompare in class AbstractTopN<Tuple2id>i - indexj - indexprotected void swap(int i,
int j)
AbstractTopNswap in class AbstractTopN<Tuple2id>i - indexj - indexCopyright © 2016. All rights reserved.