V
- Value typepublic interface IntegerObjectHeap<V>
Modifier and Type | Interface and Description |
---|---|
static interface |
IntegerObjectHeap.UnsortedIter<V>
Unsorted iterator - in heap order.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int key,
V val)
Add a key-value pair to the heap
|
void |
add(int key,
V val,
int k)
Add a key-value pair to the heap if it improves the top.
|
void |
clear()
Clear the heap contents.
|
boolean |
containsKey(int q)
Contains operation for a key (slow: with a linear scan).
|
boolean |
containsValue(V q)
Contains operation for a value (slow: with a linear scan).
|
boolean |
isEmpty()
Is the heap empty?
|
int |
peekKey()
Get the current top key.
|
V |
peekValue()
Get the current top value.
|
void |
poll()
Remove the first element.
|
void |
replaceTopElement(int key,
V val)
Combined operation that removes the top element, and inserts a new element instead.
|
int |
size()
Query the size.
|
IntegerObjectHeap.UnsortedIter<V> |
unsortedIter()
Get an unsorted iterator to inspect the heap.
|
void add(int key, V val)
key
- Keyval
- Valuevoid add(int key, V val, int k)
key
- Keyval
- Valuek
- Desired maximum sizevoid replaceTopElement(int key, V val)
key
- Key of new elementval
- Value of new elementint peekKey()
V peekValue()
boolean containsKey(int q)
q
- Keytrue
if the key is contained in the heap.boolean containsValue(V q)
q
- Valuetrue
if the value is contained in the heap.void poll()
void clear()
int size()
boolean isEmpty()
true
when the size is 0.IntegerObjectHeap.UnsortedIter<V> unsortedIter()
Copyright © 2019 ELKI Development Team. License information.