org.jrdf.util
Class FlatteningThreeLongClosableIterator

java.lang.Object
  extended by org.jrdf.util.FlatteningThreeLongClosableIterator
All Implemented Interfaces:
Iterator<Long[]>, ClosableIterator<Long[]>

public class FlatteningThreeLongClosableIterator
extends Object
implements ClosableIterator<Long[]>


Field Summary
protected  Map.Entry<Long,ClosableMap<Long,Set<Long>>> firstEntry
           
protected  Iterator<Long> itemIterator
           
protected  ClosableIterator<Map.Entry<Long,ClosableMap<Long,Set<Long>>>> iterator
           
protected  Map.Entry<Long,Set<Long>> secondEntry
           
protected  Iterator<Map.Entry<Long,Set<Long>>> subIterator
           
 
Constructor Summary
FlatteningThreeLongClosableIterator(ClosableIterator<Map.Entry<Long,ClosableMap<Long,Set<Long>>>> entryIterator)
           
 
Method Summary
 boolean close()
          Closes the iterator by freeing any resources that it current holds.
 boolean hasNext()
           
 Long[] next()
           
 void remove()
           
protected  void updatePosition()
          Helper method to move the iterators on to the next position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

protected ClosableIterator<Map.Entry<Long,ClosableMap<Long,Set<Long>>>> iterator

subIterator

protected Iterator<Map.Entry<Long,Set<Long>>> subIterator

itemIterator

protected Iterator<Long> itemIterator

firstEntry

protected Map.Entry<Long,ClosableMap<Long,Set<Long>>> firstEntry

secondEntry

protected Map.Entry<Long,Set<Long>> secondEntry
Constructor Detail

FlatteningThreeLongClosableIterator

public FlatteningThreeLongClosableIterator(ClosableIterator<Map.Entry<Long,ClosableMap<Long,Set<Long>>>> entryIterator)
Method Detail

close

public boolean close()
Description copied from interface: ClosableIterator
Closes the iterator by freeing any resources that it current holds.

This must be done as soon as possible. Once an iterator is closed none of the operations on a iterator will operate i.e. they will throw an exception.

Specified by:
close in interface ClosableIterator<Long[]>
Returns:
true if it was successfully closed.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Long[]>

next

public Long[] next()
Specified by:
next in interface Iterator<Long[]>

updatePosition

protected void updatePosition()
Helper method to move the iterators on to the next position. If there is no next position then itemIterator will be set to null, telling hasNext to return false.


remove

public void remove()
Specified by:
remove in interface Iterator<Long[]>