gate.jape
Class PatternElement

java.lang.Object
  |
  +--gate.jape.PatternElement
All Implemented Interfaces:
Cloneable, JapeConstants, Matcher, Serializable
Direct Known Subclasses:
BasicPatternElement, ComplexPatternElement, ConstraintGroup

public abstract class PatternElement
extends Object
implements Cloneable, Matcher, JapeConstants, Serializable

Superclass of the various types of pattern element, and of ConstraintGroup. Inherits from Matcher, providing matches and reset. Provides access to the annotations that are cached by subclasses, and multilevel rollback of those caches. Stores the match history.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gate.jape.JapeConstants
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING
 
Constructor Summary
PatternElement()
          Anonymous construction.
 
Method Summary
 Object clone()
          Cloning for processing of macro references.
abstract  AnnotationSet getMatchedAnnots()
          Access to the annotations that have been matched.
 void reset()
          Reset: clear annotation caches etc.
abstract  void rollback(int arity)
          Multilevel rollback of annotation caches.
abstract  String toString(String pad)
          Create a string representation of the object with padding.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.jape.Matcher
finish, matches
 

Constructor Detail

PatternElement

public PatternElement()
Anonymous construction.

Method Detail

clone

public Object clone()
Cloning for processing of macro references. Note that it doesn't really clone the match history, just set it to a new Stack. This is because a) JGL doesn't have real clone methods and b) we don't actually need it anywhere but during parsing the .jape, where there is no match history yet.

Overrides:
clone in class Object

getMatchedAnnots

public abstract AnnotationSet getMatchedAnnots()
Access to the annotations that have been matched.


rollback

public abstract void rollback(int arity)
Multilevel rollback of annotation caches.


reset

public void reset()
Reset: clear annotation caches etc. Most of the behaviour of this method is the responsibility of subclasses.

Specified by:
reset in interface Matcher

toString

public abstract String toString(String pad)
Create a string representation of the object with padding.