public Iterator < AddressableHeap . Handle < K , V > > handlesIterator ( ) { return new Iterator < AddressableHeap . Handle < K , V > > ( ) { private int pos = 1 ; public boolean hasNext ( ) { return pos <= size ; } public AddressableHeap . Handle < K , V > next ( ) { return array [ pos ++ ] ; } public void remove ( ) { throw new UnsupportedOperationException ( ) ; } } ; }
Get an iterator for all handles currently in the heap .