Class Choicepoint
- java.lang.Object
-
- com.yahoo.prelude.semantics.engine.Choicepoint
-
public class Choicepoint extends Object
A choice point in an rule evaluation. A choicepoint is open if there are other choices to make at the point, closed if there are no further choices. In addition it contains enough information to enable the rule evaluation to backtrack to this point- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Choicepoint.State
The state of this choicepoint
-
Constructor Summary
Constructors Constructor Description Choicepoint(RuleEvaluation e, Condition condition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTry()
Registers that another try has been madevoid
backtrack()
Backtrack to the evaluation state at the point where this choicepoint were instantiated.void
backtrackPosition()
Backtracks the position only, not matchesvoid
close()
Marks this choice point as closed (!open) - there are no further choices to exploreCondition
getCondition()
Returns the condition which created this choice pointChoicepoint.State
getState()
Returns the state of this choice pointboolean
isOpen()
Returns wether there are (or may be) open choices to explore at this choicepoint yetint
tryCount()
Returns the number open tries made at this pointvoid
updateState()
Updates the state of this choice point to the current state of its evaluation
-
-
-
Constructor Detail
-
Choicepoint
public Choicepoint(RuleEvaluation e, Condition condition)
-
-
Method Detail
-
getCondition
public Condition getCondition()
Returns the condition which created this choice point
-
isOpen
public boolean isOpen()
Returns wether there are (or may be) open choices to explore at this choicepoint yet
-
close
public void close()
Marks this choice point as closed (!open) - there are no further choices to explore
-
tryCount
public int tryCount()
Returns the number open tries made at this point
-
addTry
public void addTry()
Registers that another try has been made
-
backtrack
public void backtrack()
Backtrack to the evaluation state at the point where this choicepoint were instantiated.
-
backtrackPosition
public void backtrackPosition()
Backtracks the position only, not matches
-
updateState
public void updateState()
Updates the state of this choice point to the current state of its evaluation
-
getState
public Choicepoint.State getState()
Returns the state of this choice point
-
-