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)
TopDownRuleIndex
add
in interface TopDownRuleIndex
public Iterable<Rule> getRules(int parentState)
TopDownRuleIndex
getRules
in interface TopDownRuleIndex
public void foreachRule(int parentState, Consumer<Rule> fn)
foreachRule
in interface TopDownRuleIndex
public IntIterable getLabelsTopDown(int parentState)
TopDownRuleIndex
getLabelsTopDown
in interface TopDownRuleIndex
public Iterable<Rule> getRules(int labelId, int parentState)
TopDownRuleIndex
getRules
in interface TopDownRuleIndex
public boolean useCachedRule(int label, int parent)
TopDownRuleIndex
useCachedRule
in interface TopDownRuleIndex
public Iterable<Rule> getAllRules()
getAllRules
in interface TopDownRuleIndex
Copyright © 2017. All rights reserved.