gate.jape
Class ConstraintGroup

java.lang.Object
  extended by gate.jape.PatternElement
      extended by gate.jape.ConstraintGroup
All Implemented Interfaces:
JapeConstants, Serializable, Cloneable

public class ConstraintGroup
extends PatternElement
implements JapeConstants, Serializable

A sequence of conjunctions of PatternElements that form a disjunction.

See Also:
Serialized Form

Field Summary
private  ArrayList currentConjunction
          An array of PatternElements making up a conjunction.
private static boolean DEBUG
          Debug flag
private  ArrayList patternElementDisjunction1
          An array of arrays that represent PatternElement conjunctions during parsing of the .jape.
private  PatternElement[][] patternElementDisjunction2
          The pattern element disjunction for transduction - Java arrays.
 
Fields inherited from class gate.jape.PatternElement
matchHistory
 
Fields inherited from interface gate.jape.JapeConstants
ALL_STYLE, 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
ConstraintGroup()
          Anonymous constructor.
 
Method Summary
 void addPatternElement(PatternElement pe)
          Add an element to the current conjunction.
 Object clone()
          Need cloning for processing of macro references.
 void createDisjunction()
          Make a new disjunction at this point.
 void finish()
          Finish: replace dynamic data structures with Java arrays; called after parsing.
 void getContainedAnnotationTypes(HashSet<String> set)
          Populate the HashSet passed as a parameter with all the annotation types that occur in this and recursively contained pattern elements.
protected  Iterator getCPEs()
          Get an list of CPEs that we contain.
 PatternElement[][] getPatternElementDisjunction()
           
 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

patternElementDisjunction1

private ArrayList patternElementDisjunction1
An array of arrays that represent PatternElement conjunctions during parsing of the .jape. Each conjunction is considered as being disjunct with the next. (I.e. they are or'd, in the same way as expressions around "||" in C and Java.) Set during parsing; replaced by finish().


patternElementDisjunction2

private PatternElement[][] patternElementDisjunction2
The pattern element disjunction for transduction - Java arrays.


currentConjunction

private ArrayList currentConjunction
An array of PatternElements making up a conjunction. It is a member of patternElementDisjunction. This is the one we're adding to at present. Used during parsing, not matching.

Constructor Detail

ConstraintGroup

public ConstraintGroup()
Anonymous constructor.

Method Detail

clone

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

Overrides:
clone in class PatternElement

createDisjunction

public void createDisjunction()
Make a new disjunction at this point.


addPatternElement

public void addPatternElement(PatternElement pe)
Add an element to the current conjunction.


getCPEs

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


getContainedAnnotationTypes

public void getContainedAnnotationTypes(HashSet<String> set)
Populate the HashSet passed as a parameter with all the annotation types that occur in this and recursively contained pattern elements.


finish

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

Specified by:
finish in class PatternElement

toString

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

Overrides:
toString in class Object

toString

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

Specified by:
toString in class PatternElement

getPatternElementDisjunction

public PatternElement[][] getPatternElementDisjunction()