gate.jape
Class PrioritisedRuleList

java.lang.Object
  |
  +--com.objectspace.jgl.DList
        |
        +--gate.jape.PrioritisedRuleList
All Implemented Interfaces:
Cloneable, com.objectspace.jgl.Container, com.objectspace.jgl.Sequence, Serializable

public class PrioritisedRuleList
extends com.objectspace.jgl.DList
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

Inner classes inherited from class com.objectspace.jgl.DList
com.objectspace.jgl.DList.DListNode
 
Field Summary
private static boolean DEBUG
          Debug flag
 
Fields inherited from class com.objectspace.jgl.DList
myLength, myNode, serialVersionUID
 
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 com.objectspace.jgl.DList
add, at, back, begin, checkRange, clear, clone, contains, copy, count, count, count, elements, end, equals, equals, find, find, finish, front, hashCode, indexOf, indexOf, insert, insert, insert, insert, insert, insert, insert, insert, isEmpty, iteratorAt, maxSize, nodeAt, popBack, popFront, pushBack, pushFront, put, readObject, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, remove, replace, replace, replace, reverse, size, splice, splice, splice, splice, splice, splice, splice, splice, start, swap, toString, transfer, unique, writeObject
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag
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.