public class MapTopDownIndex extends Object implements TopDownRuleIndex, Serializable
| Constructor and Description |
|---|
MapTopDownIndex(TreeAutomaton auto) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Rule rule)
Adds a rule to the index.
|
void |
foreachRule(int parentState,
Consumer<Rule> fn) |
Iterable<Rule> |
getAllRules() |
IntIterable |
getLabelsTopDown(int parentState)
Retrieves the terminal symbols such that rules for
the given parent state exist.
|
Iterable<Rule> |
getRules(int parentState)
Retrieves the rules for a given parent state.
|
Iterable<Rule> |
getRules(int labelId,
int parentState)
Retrieves the rules for a given parent state and terminal
symbol.
|
String |
toString() |
boolean |
useCachedRule(int label,
int parent)
Checks whether top-down rules for this parent state and label
should be looked up in this index.
|
public MapTopDownIndex(TreeAutomaton auto)
public void add(Rule rule)
TopDownRuleIndexadd in interface TopDownRuleIndexpublic Iterable<Rule> getRules(int parentState)
TopDownRuleIndexgetRules in interface TopDownRuleIndexpublic void foreachRule(int parentState,
Consumer<Rule> fn)
foreachRule in interface TopDownRuleIndexpublic IntIterable getLabelsTopDown(int parentState)
TopDownRuleIndexgetLabelsTopDown in interface TopDownRuleIndexpublic Iterable<Rule> getRules(int labelId, int parentState)
TopDownRuleIndexgetRules in interface TopDownRuleIndexpublic boolean useCachedRule(int label,
int parent)
TopDownRuleIndexuseCachedRule in interface TopDownRuleIndexpublic Iterable<Rule> getAllRules()
getAllRules in interface TopDownRuleIndexCopyright © 2017. All rights reserved.