gate.jape
Class PrioritisedRuleList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
gate.jape.PrioritisedRuleList
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, List, RandomAccess
public class PrioritisedRuleList
- extends ArrayList
- implements Serializable
A list of rules ordered according to priority. May be used for ordering
non-matched rules (in which case the order is based on
priority/position), or matched rules (in which case the order is based
on matched lenght/priority/position). Note that position represents
the idea of order within an input file; it is assumed that this is the
same as the order of addition of the rules to the list, i.e. a rule
added 5th is assumed to occupy 5th place in the file (or other rule
source). This class is based on JGL's DList, which allows for fast
insertion of elements at any point. The highest priority rule is the
first in the list, which may be accessed by front()
.
- See Also:
- Serialized Form
Method Summary |
void |
add(Rule newRule)
Adds a rule in order. |
void |
add(Rule newRule,
int newRuleLength)
Adds a rule in order. |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
PrioritisedRuleList
public PrioritisedRuleList()
add
public void add(Rule newRule)
- Adds a rule in order. Used for non-matched rules. Implements the
ordering based on priority/position.
add
public void add(Rule newRule,
int newRuleLength)
- Adds a rule in order. Used for matched rules. Implements the
ordering based on length/priority/position. Length is given as
a parameter.