Jet.Pat
Class PatternCollection

java.lang.Object
  extended byJet.Pat.PatternCollection

public class PatternCollection
extends java.lang.Object


Field Summary
 java.util.Vector patternNames
           
 java.util.Hashtable patterns
           
 java.util.Vector patternSetNames
           
 java.util.Hashtable patternSets
           
 
Constructor Summary
PatternCollection()
          creates an empty PatternCollection
 
Method Summary
 void apply(java.lang.String patternSetName, Document doc)
          applies the rules in the named PatternSet to the document.
 void apply(java.lang.String patternSetName, Document doc, Span span)
          applies the rules in the named PatternSet to the specified span.
 PatternElement dereference(java.lang.String patternName)
          returns pattern named patternName, or null if no such pattern exists (alias for getPattern)
 PatternElement getPattern(java.lang.String patternName)
          returns pattern named patternName, or null if no such pattern exists
 PatternSet getPatternSet(java.lang.String patternSetName)
          returns pattern set named patternSetName, or null if no such pattern set exists
 void makePatternGraph()
          converts the set of rules in all pattern sets of this pattern collection into pattern graphs.
 void readPatternCollection(java.io.Reader reader)
          reads a file of pattern statements using reader and builds (or augments) a PatternCollection in the form of patterns and rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patterns

public java.util.Hashtable patterns

patternSets

public java.util.Hashtable patternSets

patternNames

public java.util.Vector patternNames

patternSetNames

public java.util.Vector patternSetNames
Constructor Detail

PatternCollection

public PatternCollection()
creates an empty PatternCollection

Method Detail

readPatternCollection

public void readPatternCollection(java.io.Reader reader)
                           throws java.io.IOException
reads a file of pattern statements using reader and builds (or augments) a PatternCollection in the form of patterns and rules.

Throws:
java.io.IOException

getPattern

public PatternElement getPattern(java.lang.String patternName)
returns pattern named patternName, or null if no such pattern exists


dereference

public PatternElement dereference(java.lang.String patternName)
returns pattern named patternName, or null if no such pattern exists (alias for getPattern)


getPatternSet

public PatternSet getPatternSet(java.lang.String patternSetName)
returns pattern set named patternSetName, or null if no such pattern set exists


makePatternGraph

public void makePatternGraph()
converts the set of rules in all pattern sets of this pattern collection into pattern graphs. Once the rules have been converted to graphs, they can be applied to a document using the apply method.


apply

public void apply(java.lang.String patternSetName,
                  Document doc)
applies the rules in the named PatternSet to the document. If no such pattern set exists, no action is performed.


apply

public void apply(java.lang.String patternSetName,
                  Document doc,
                  Span span)
applies the rules in the named PatternSet to the specified span. If no such pattern set exists, no action is performed.