gate.jape
Class ComplexPatternElement

java.lang.Object
  extended bygate.jape.PatternElement
      extended bygate.jape.ComplexPatternElement
All Implemented Interfaces:
Cloneable, JapeConstants, Matcher, Serializable

public class ComplexPatternElement
extends PatternElement
implements JapeConstants, Serializable

A pattern element enclosed in round brackets. Has a ConstraintGroups, Kleene operator and binding name.

See Also:
Serialized Form

Field Summary
private  String bindingName
          Binding name (may be null).
private  ConstraintGroup constraintGroup
          The recursive definition of what pattern elements make up this one.
private static boolean DEBUG
          Debug flag
private  int kleeneOp
          Kleene operator (defaults to none).
 
Fields inherited from class gate.jape.PatternElement
matchHistory
 
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
ComplexPatternElement(ConstraintGroup constraintGroup, int kleeneOp, String bindingName)
          Construction from ConstraintGroup, Kleene operator type and binding name.
 
Method Summary
 Object clone()
          Need cloning for processing of macro references.
 void finish()
          Finish: replace dynamic data structures with Java arrays; called after parsing.
 String getBindingName()
          Get binding name.
 ConstraintGroup getConstraintGroup()
           
protected  Iterator getCPEs()
          Get a list of CPEs that we contain.
 int getKleeneOp()
           
 AnnotationSet getMatchedAnnots()
          Access to the annotations that have been matched.
 boolean matches(Document doc, int position, MutableInteger newPosition)
          Does this element match the document at this position?
 void reset()
          Reset: clear caches of annotations matched.
 void rollback(int arity)
          Multilevel rollback of annotation caches.
 String toString()
          Create a string representation of the object.
 String toString(String pad)
          Create a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

See Also:
Constant Field Values

kleeneOp

private int kleeneOp
Kleene operator (defaults to none). Other values: KLEENE_STAR (*); KLEENE_PLUS (+); KLEENE_QUERY (?)


bindingName

private String bindingName
Binding name (may be null).


constraintGroup

private ConstraintGroup constraintGroup
The recursive definition of what pattern elements make up this one.

Constructor Detail

ComplexPatternElement

public ComplexPatternElement(ConstraintGroup constraintGroup,
                             int kleeneOp,
                             String bindingName)
Construction from ConstraintGroup, Kleene operator type and binding name. Kleene types are defined in JapeConstants.

Method Detail

getBindingName

public String getBindingName()
Get binding name.


getCPEs

protected Iterator getCPEs()
Get a list of CPEs that we contain.


clone

public Object clone()
Need cloning for processing of macro references. See comments on PatternElement.clone()

Overrides:
clone in class PatternElement

finish

public void finish()
Finish: replace dynamic data structures with Java arrays; called after parsing.

Specified by:
finish in interface Matcher

getMatchedAnnots

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

Specified by:
getMatchedAnnots in class PatternElement

reset

public void reset()
Reset: clear caches of annotations matched.

Specified by:
reset in interface Matcher
Overrides:
reset in class PatternElement

rollback

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

Specified by:
rollback in class PatternElement

matches

public boolean matches(Document doc,
                       int position,
                       MutableInteger newPosition)
Does this element match the document at this position?

Specified by:
matches in interface Matcher

toString

public String toString()
Create a string representation of the object.


toString

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

Specified by:
toString in class PatternElement

getKleeneOp

public int getKleeneOp()

getConstraintGroup

public ConstraintGroup getConstraintGroup()