com.karneim.util.collection.regex
Class PatternPro

java.lang.Object
  extended by com.karneim.util.collection.regex.Pattern
      extended by com.karneim.util.collection.regex.PatternPro
All Implemented Interfaces:
java.lang.Cloneable

public class PatternPro
extends Pattern

Regular expression based on a minimized deterministic automaton (FSA) and designed as a set of strings.
Use this class to manipulate a reular expression through set oprations or automaton methods
PatternPro differs from Pattern that the contributed set of strings is mutable through the methods addAll, removeAll and retainAll.
Further PaternPro provides access to its PAutomaton through the getAutomaton method. So it is possible to inspect the automaton's states through PAutomaton's methods.

Version:
1.0
Author:
Ralf Meyer

Field Summary
 
Fields inherited from class com.karneim.util.collection.regex.Pattern
automaton, AUTOMATON_MAP
 
Constructor Summary
  PatternPro()
           
protected PatternPro(Automaton_Pattern automaton)
           
protected PatternPro(ISet_char fullSet)
           
  PatternPro(Pattern p)
          copy constructor
  PatternPro(PAutomaton automaton)
          creates a PatternPro with the given automaton.
  PatternPro(java.lang.String regEx)
           
 
Method Summary
 void addAll(Pattern pattern)
           
 void addAll(PAutomaton a)
           
 void addAll(java.lang.String regEx)
           
 void clear()
           
 void complement()
           
 boolean contains(char[] chars, int offset, int length)
           
 boolean contains(java.io.Reader in)
           
 boolean contains(java.lang.String s, int offset, int length)
           
 PAutomaton getAutomaton()
           
protected  AutomatonSet_String getInnerAutomaton()
           
 Pattern getPattern()
          Deprecated.  
 void removeAll(Pattern pattern)
           
 void removeAll(PAutomaton a)
           
 void removeAll(java.lang.String regEx)
           
 void retainAll(Pattern pattern)
           
 void retainAll(PAutomaton a)
           
 void retainAll(java.lang.String regEx)
           
 void setAutomaton(PAutomaton a)
           
 void setPattern(Pattern p)
          Deprecated.  
 void setRegEx(java.lang.String regEx)
           
 
Methods inherited from class com.karneim.util.collection.regex.Pattern
clone, contains, contains, contains, contains, get, getRegEx, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatternPro

protected PatternPro(ISet_char fullSet)

PatternPro

protected PatternPro(Automaton_Pattern automaton)

PatternPro

public PatternPro()

PatternPro

public PatternPro(PAutomaton automaton)
creates a PatternPro with the given automaton. The automaton will not be cloned: two PatternPro can use the same automaton.


PatternPro

public PatternPro(Pattern p)
copy constructor


PatternPro

public PatternPro(java.lang.String regEx)
Method Detail

getInnerAutomaton

protected AutomatonSet_String getInnerAutomaton()

setRegEx

public void setRegEx(java.lang.String regEx)

setPattern

public void setPattern(Pattern p)
Deprecated. 

if p is an instance of PatternPro use setAutomaton(p.getAutomaton()); else setAutomaton(new PatternPro(p).getAutomaton())


setAutomaton

public void setAutomaton(PAutomaton a)

getPattern

public Pattern getPattern()
Deprecated. 

don't needed: you have a PatternPro which extends Pattern. (Pattern)this.clone() has the same effect


getAutomaton

public PAutomaton getAutomaton()

contains

public boolean contains(java.lang.String s,
                        int offset,
                        int length)
Overrides:
contains in class Pattern

contains

public boolean contains(char[] chars,
                        int offset,
                        int length)
Overrides:
contains in class Pattern

contains

public boolean contains(java.io.Reader in)
                 throws java.io.IOException
Overrides:
contains in class Pattern
Throws:
java.io.IOException

complement

public void complement()

addAll

public void addAll(java.lang.String regEx)

retainAll

public void retainAll(java.lang.String regEx)

removeAll

public void removeAll(java.lang.String regEx)

addAll

public void addAll(Pattern pattern)

retainAll

public void retainAll(Pattern pattern)

removeAll

public void removeAll(Pattern pattern)

addAll

public void addAll(PAutomaton a)

retainAll

public void retainAll(PAutomaton a)

removeAll

public void removeAll(PAutomaton a)

clear

public void clear()