Class IntegerObjectMaxHeap.UnsortedIter
- java.lang.Object
-
- elki.utilities.datastructures.heap.IntegerObjectMaxHeap.UnsortedIter
-
- All Implemented Interfaces:
IntegerObjectHeap.UnsortedIter<V>
,Iter
- Enclosing class:
- IntegerObjectMaxHeap<V>
private class IntegerObjectMaxHeap.UnsortedIter extends java.lang.Object implements IntegerObjectHeap.UnsortedIter<V>
Unsorted iterator - in heap order. Does not poll the heap.Use this class as follows:
for (IntegerObjectHeap.UnsortedIter<V> iter = heap.unsortedIter(); iter.valid(); iter.next()) { doSomething(iter.get()); }
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected int
pos
Iterator position.
-
Constructor Summary
Constructors Modifier Constructor Description private
UnsortedIter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerObjectMaxHeap.UnsortedIter
advance()
Moves the iterator forward to the next entry.int
getKey()
Get the current key.V
getValue()
Get the current value.boolean
valid()
Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
valid
public boolean valid()
Description copied from interface:Iter
Returns true if the iterator currently points to a valid object.
-
advance
public IntegerObjectMaxHeap.UnsortedIter advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
getKey
public int getKey()
Description copied from interface:IntegerObjectHeap.UnsortedIter
Get the current key.- Specified by:
getKey
in interfaceIntegerObjectHeap.UnsortedIter<V>
- Returns:
- Current key
-
getValue
public V getValue()
Description copied from interface:IntegerObjectHeap.UnsortedIter
Get the current value.- Specified by:
getValue
in interfaceIntegerObjectHeap.UnsortedIter<V>
- Returns:
- Current value
-
-