Class ComparableMaxHeap.UnsortedIter
- java.lang.Object
-
- elki.utilities.datastructures.heap.ComparableMaxHeap.UnsortedIter
-
- All Implemented Interfaces:
ObjectHeap.UnsortedIter<K>
,Iter
- Enclosing class:
- ComparableMaxHeap<K extends java.lang.Comparable<? super K>>
private class ComparableMaxHeap.UnsortedIter extends java.lang.Object implements ObjectHeap.UnsortedIter<K>
Unsorted iterator - in heap order. Does not poll the heap.Use this class as follows:
for (ObjectHeap.UnsortedIter<K> 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 ComparableMaxHeap.UnsortedIter
advance()
Moves the iterator forward to the next entry.K
get()
Get the iterators current object.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 ComparableMaxHeap.UnsortedIter advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
get
public K get()
Description copied from interface:ObjectHeap.UnsortedIter
Get the iterators current object.- Specified by:
get
in interfaceObjectHeap.UnsortedIter<K extends java.lang.Comparable<? super K>>
- Returns:
- Current object
-
-