public class ChoicePointFrame extends GenericChoiceFrame
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 and Description |
---|
ChoicePointFrame(LPInterpreter interpreter,
List<RuleClauseCode> predicateClauses,
boolean isSingleton)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
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.
|
RuleClauseCode |
nextClause()
Return the next clause in the sequence.
|
void |
noteSuccess()
Note successful return from this choice point.
|
init, setContinuation
close, fastLinkTo, getLink, linkTo
public ChoicePointFrame(LPInterpreter interpreter, List<RuleClauseCode> predicateClauses, boolean isSingleton)
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 resultpublic void init(LPInterpreter interpreter, List<RuleClauseCode> predicateClauses)
interpreter
- the LPInterpreter whose state is to be preservedpredicateClauses
- the list of predicates for this choice pointpublic boolean hasNext()
public RuleClauseCode nextClause()
public void noteSuccess()
Licenced under the Apache License, Version 2.0