java.lang.Object
org.apache.jena.reasoner.rulesys.impl.FrameObject
org.apache.jena.reasoner.rulesys.impl.GenericChoiceFrame
org.apache.jena.reasoner.rulesys.impl.ChoicePointFrame
Represents a single frame in the LP interpreter's choice point stack,
represents the OR part of the search tree.
This is used in the inner loop of the interpreter and so is a pure data structure not an abstract data type and assumes privileged access to the interpreter state.
-
Constructor Summary
ConstructorDescriptionChoicePointFrame
(LPInterpreter interpreter, List<RuleClauseCode> predicateClauses, boolean isSingleton) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
Is there another clause in the sequence?void
init
(LPInterpreter interpreter, List<RuleClauseCode> predicateClauses) Initialize a choice point to preserve the current context of the given intepreter and then call the given set of predicates.Return the next clause in the sequence.void
Note successful return from this choice point.Methods inherited from class org.apache.jena.reasoner.rulesys.impl.GenericChoiceFrame
init, setContinuation
Methods inherited from class org.apache.jena.reasoner.rulesys.impl.FrameObject
close, fastLinkTo, getLink, linkTo
-
Constructor Details
-
ChoicePointFrame
public ChoicePointFrame(LPInterpreter interpreter, List<RuleClauseCode> predicateClauses, boolean isSingleton) Constructor. Initialize a choice point to preserve the current context of the given intepreter and then call the given set of predicates.- Parameters:
interpreter
- the LPInterpreter whose state is to be preservedpredicateClauses
- the list of predicates for this choice pointisSingleton
- true if this choice should abort after one successful result
-
-
Method Details
-
init
Initialize a choice point to preserve the current context of the given intepreter and then call the given set of predicates.- Parameters:
interpreter
- the LPInterpreter whose state is to be preservedpredicateClauses
- the list of predicates for this choice point
-
hasNext
public boolean hasNext()Is there another clause in the sequence? -
nextClause
Return the next clause in the sequence. -
noteSuccess
public void noteSuccess()Note successful return from this choice point. This closes the choice point if it is a singleton.
-