Class ChoicePointFrame
- java.lang.Object
-
- org.apache.jena.reasoner.rulesys.impl.FrameObject
-
- org.apache.jena.reasoner.rulesys.impl.GenericChoiceFrame
-
- org.apache.jena.reasoner.rulesys.impl.ChoicePointFrame
-
public class ChoicePointFrame extends GenericChoiceFrame
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
Constructors Constructor Description ChoicePointFrame(LPInterpreter interpreter, java.util.List<RuleClauseCode> predicateClauses, boolean isSingleton)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Is there another clause in the sequence?void
init(LPInterpreter interpreter, java.util.List<RuleClauseCode> predicateClauses)
Initialize a choice point to preserve the current context of the given intepreter and then call the given set of predicates.RuleClauseCode
nextClause()
Return the next clause in the sequence.void
noteSuccess()
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 Detail
-
ChoicePointFrame
public ChoicePointFrame(LPInterpreter interpreter, java.util.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 Detail
-
init
public void init(LPInterpreter interpreter, java.util.List<RuleClauseCode> predicateClauses)
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
public RuleClauseCode 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.
-
-