org.jrdf.graph.local.iterator
Class ResourceIterator<E>
java.lang.Object
org.jrdf.graph.local.iterator.ResourceIterator<E>
- All Implemented Interfaces:
- Iterator<E>, ClosableIterator<E>
- Direct Known Subclasses:
- AnyResourceIterator, URIReferenceResourceIterator
public abstract class ResourceIterator<E>
- extends Object
- implements ClosableIterator<E>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
longIndex012
protected final LongIndex longIndex012
resourceFactory
protected final ResourceFactory resourceFactory
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
ResourceIterator
public ResourceIterator(LongIndex[] newLongIndexes,
ResourceFactory newResourceFactory,
NodePool newNodePool)
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()
getNextNodeId
protected abstract long getNextNodeId(Iterator<Map.Entry<Long,Map<Long,Set<Long>>>> iterator)
- Provides a customizable way in which to filter out resource nodes based on type.
- Parameters:
iterator - iterators over the index.
- Returns:
- the next node identifier.