gate.jape
Class PrioritisedRuleList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by 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

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PrioritisedRuleList()
           
 
Method Summary
 void add(Rule newRule)
          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
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, 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.