Class LPTopGoalIterator
- java.lang.Object
-
- org.apache.jena.reasoner.rulesys.impl.LPTopGoalIterator
-
- All Implemented Interfaces:
java.util.Iterator<Triple>
,IteratorCloseable<Triple>
,Closeable
,LPInterpreterContext
,LPInterpreterState
,ClosableIterator<Triple>
public class LPTopGoalIterator extends java.lang.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 Constructor Description LPTopGoalIterator(LPInterpreter engine)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the iterator.boolean
hasNext()
boolean
isReady()
Return true if the iterator is ready to be scheduled (i.e.Triple
next()
void
notifyBlockedOn(ConsumerChoicePointFrame ccp)
Notify this context that a branch was suspended awaiting further results from the given generator.void
notifyFinished(ConsumerChoicePointFrame ccp)
Notify this context that the given choice point has terminated and can be remove from the wait list.void
remove()
void
setReady(ConsumerChoicePointFrame ccp)
Directly set that this generator is ready (because the generating for one of its generatingCPs has produced new results).
-
-
-
Constructor Detail
-
LPTopGoalIterator
public LPTopGoalIterator(LPInterpreter engine)
Constructor. Wraps a top level goal state as an iterator
-
-
Method Detail
-
notifyBlockedOn
public void notifyBlockedOn(ConsumerChoicePointFrame ccp)
Notify this context that a branch was suspended awaiting further results from the given generator.- Specified by:
notifyBlockedOn
in interfaceLPInterpreterContext
-
notifyFinished
public void notifyFinished(ConsumerChoicePointFrame ccp)
Notify this context that the given choice point has terminated and can be remove from the wait list.- Specified by:
notifyFinished
in interfaceLPInterpreterContext
-
setReady
public void setReady(ConsumerChoicePointFrame ccp)
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 interfaceCloseable
- See Also:
ClosableIterator.close()
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<Triple>
- See Also:
Iterator.hasNext()
-
next
public Triple next()
- Specified by:
next
in interfacejava.util.Iterator<Triple>
- See Also:
Iterator.next()
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<Triple>
- See Also:
Iterator.remove()
-
-