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 TypeMethodDescriptionvoidclose()Close the iterator.booleanhasNext()booleanisReady()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()voidNotify this context that a branch was suspended awaiting further results from the given generator.voidNotify this context that the given choice point has terminated and can be remove from the wait list.voidremove()voidDirectly 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, waitMethods 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:
notifyBlockedOnin interfaceLPInterpreterContext
-
notifyFinished
Notify this context that the given choice point has terminated and can be remove from the wait list.- Specified by:
notifyFinishedin interfaceLPInterpreterContext
-
setReady
Directly set that this generator is ready (because the generating for one of its generatingCPs has produced new results).- Specified by:
setReadyin 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:
isReadyin interfaceLPInterpreterContext
-
close
public void close()Description copied from interface:ClosableIteratorClose 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:
closein interfaceClosableIterator<Triple>- Specified by:
closein interfaceorg.apache.jena.atlas.lib.Closeable- See Also:
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()
-