gate.jape
Class PrioritisedRuleList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended bygate.jape.PrioritisedRuleList
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

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

Constructor Summary
PrioritisedRuleList()
           
 
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, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

PrioritisedRuleList

public PrioritisedRuleList()
Method Detail

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.