public class Choicepoint extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Choicepoint.State
The state of this choicepoint
|
Modifier and Type | Field and Description |
---|---|
private Condition |
condition
The condition creating this choicepoint
|
private boolean |
open
Whether there are (or may be) open choices to explore at this choicepoint yet
|
private RuleEvaluation |
owner |
private Choicepoint.State |
state
The state this choice point can be rolled back to
|
private int |
tries
The number of tries made at this choice point
|
Constructor and Description |
---|
Choicepoint(RuleEvaluation e,
Condition condition) |
Modifier and Type | Method and Description |
---|---|
void |
addTry()
Registers that another try has been made
|
void |
backtrack()
Backtrack to the evaluation state at the point where this choicepoint were instantiated.
|
void |
backtrackPosition()
Backtracks the position only, not matches
|
void |
close()
Marks this choice point as closed (!open) - there are no further choices to explore
|
Condition |
getCondition()
Returns the condition which created this choice point
|
Choicepoint.State |
getState()
Returns the state of this choice point
|
boolean |
isOpen()
Returns wether there are (or may be) open choices to explore at this choicepoint yet
|
int |
tryCount()
Returns the number open tries made at this point
|
void |
updateState()
Updates the state of this choice point to the current state of its evaluation
|
private boolean open
private int tries
private Condition condition
private Choicepoint.State state
private RuleEvaluation owner
public Choicepoint(RuleEvaluation e, Condition condition)
public Condition getCondition()
public boolean isOpen()
public void close()
public int tryCount()
public void addTry()
public void backtrack()
public void backtrackPosition()
public void updateState()
public Choicepoint.State getState()
Copyright © 2017. All rights reserved.