org.jrdf.graph.local.mem.iterator
Class AnyResourceIterator

java.lang.Object
  extended by org.jrdf.graph.local.mem.iterator.AnyResourceIterator
All Implemented Interfaces:
Iterator<Resource>, ClosableIterator<Resource>

public class AnyResourceIterator
extends Object


Field Summary
protected  boolean firstTime
           
protected  GraphHandler graphHandler012
           
protected  GraphHandler graphHandler201
           
protected  Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> iterator012
           
protected  Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> iterator201
           
protected  LongIndex longIndex012
           
protected  Resource nextResource
           
protected  NodePool nodePool
           
protected  ResourceFactory resourceFactory
           
 
Constructor Summary
AnyResourceIterator(LongIndex[] newLongIndexes, GraphHandler[] newGraphHandlers, ResourceFactory newResourceFactory, NodePool newNodePool)
           
 
Method Summary
 boolean close()
          Closes the iterator by freeing any resources that it current holds.
protected  long getNextNodeID(Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> iterator, GraphHandler graphHandler)
          Provides a customizable way in which to filter out resource nodes based on type.
protected  Resource getNextResource()
           
 boolean hasNext()
           
 Resource next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longIndex012

protected final LongIndex longIndex012

graphHandler012

protected final GraphHandler graphHandler012

resourceFactory

protected final ResourceFactory resourceFactory

graphHandler201

protected final GraphHandler graphHandler201

iterator012

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

iterator201

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

nextResource

protected Resource nextResource

firstTime

protected boolean firstTime

nodePool

protected NodePool nodePool
Constructor Detail

AnyResourceIterator

public AnyResourceIterator(LongIndex[] newLongIndexes,
                           GraphHandler[] newGraphHandlers,
                           ResourceFactory newResourceFactory,
                           NodePool newNodePool)
Method Detail

next

public Resource next()

getNextNodeID

protected long getNextNodeID(Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> iterator,
                             GraphHandler graphHandler)
Provides a customizable way in which to filter out resource nodes based on type.

Parameters:
iterator - iterators over the index.
graphHandler - used to create the nodes from the iterator.
Returns:
the next node identifier.

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<E>
Returns:
true if it was successfully closed.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

remove

public void remove()
Specified by:
remove in interface Iterator<E>

getNextResource

protected Resource getNextResource()