org.progeeks.util
Class PatternSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by org.progeeks.util.PatternSet
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.Set

public class PatternSet
extends java.util.AbstractSet

A set of patterns that can be checked against a string for pattern matches.

Version:
$Revision: 1.1 $
Author:
Paul Speed

Constructor Summary
PatternSet()
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 void compile()
          Precompiles the pattern set into a single internal pattern.
 java.util.Set getExactMatches()
          Returns the mutable set of strings that will be used for exact match testing before checking the set of regular expressions.
 java.util.Iterator iterator()
           
 boolean matches(java.lang.CharSequence seq)
          Returns true if any of the collection patterns match the specified char sequence.
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

PatternSet

public PatternSet()
Method Detail

getExactMatches

public java.util.Set getExactMatches()
Returns the mutable set of strings that will be used for exact match testing before checking the set of regular expressions.


size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.Set
Specified by:
size in class java.util.AbstractCollection

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.Set
Specified by:
iterator in class java.util.AbstractCollection

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set
Overrides:
add in class java.util.AbstractCollection

compile

public void compile()
Precompiles the pattern set into a single internal pattern. This is called automatically when the first match is requested.


matches

public boolean matches(java.lang.CharSequence seq)
Returns true if any of the collection patterns match the specified char sequence.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.