java.lang.Object
org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator
- All Implemented Interfaces:
Iterator<Triple>
,org.apache.jena.atlas.iterator.IteratorCloseable<Triple>
,org.apache.jena.atlas.lib.Closeable
,LPInterpreterContext
,LPInterpreterState
,ClosableIterator<Triple>
public class LPTopGoalIterator
extends Object
implements ClosableIterator<Triple>, LPInterpreterContext
Wraps up the results an LP rule engine instance into a conventional
iterator. Ensures that the engine is closed and detached from the
inference graph if the iterator hits the end of the result set.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the iterator.boolean
hasNext()
boolean
isReady()
Return true if the iterator is ready to be scheduled (i.e. it is not known to be complete and not known to be waiting for a dependent generator).next()
void
Notify this context that a branch was suspended awaiting further results from the given generator.void
Notify this context that the given choice point has terminated and can be remove from the wait list.void
remove()
void
Directly set that this generator is ready (because the generating for one of its generatingCPs has produced new results).Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
LPTopGoalIterator
Constructor. Wraps a top level goal state as an iterator
-
-
Method Details
-
notifyBlockedOn
Notify this context that a branch was suspended awaiting further results from the given generator.- Specified by:
notifyBlockedOn
in interfaceLPInterpreterContext
-
notifyFinished
Notify this context that the given choice point has terminated and can be remove from the wait list.- Specified by:
notifyFinished
in interfaceLPInterpreterContext
-
setReady
Directly set that this generator is ready (because the generating for one of its generatingCPs has produced new results).- Specified by:
setReady
in interfaceLPInterpreterContext
-
isReady
public boolean isReady()Return true if the iterator is ready to be scheduled (i.e. it is not known to be complete and not known to be waiting for a dependent generator).- Specified by:
isReady
in interfaceLPInterpreterContext
-
close
public void close()Description copied from interface:ClosableIterator
Close the iterator. Other operations on this iterator may now throw an exception. A ClosableIterator may be closed as many times as desired - the subsequent calls do nothing.- Specified by:
close
in interfaceClosableIterator<Triple>
- Specified by:
close
in interfaceorg.apache.jena.atlas.lib.Closeable
- See Also:
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()
-