org.pf.tools.cda.base.model.util
Class StringFilterCollection

java.lang.Object
  extended by org.pf.text.AStringFilter
      extended by org.pf.text.StringPatternCollection
          extended by org.pf.tools.cda.base.model.util.StringFilterCollection
All Implemented Interfaces:
org.pf.bif.filter.IObjectFilter<java.lang.String>, org.pf.bif.text.IJSONConvertible, org.pf.text.StringFilter

public class StringFilterCollection
extends org.pf.text.StringPatternCollection

Holds a collection of StringFilter objects and allows to check if a given string matches any or none of the filters.

Version:
1.2
Author:
Manfred Duchrow

Field Summary
 
Fields inherited from interface org.pf.bif.text.IJSONConvertible
JSON_ARRAY_END, JSON_ARRAY_START, JSON_ELEMENT_SEPARATOR, JSON_LITERAL_FALSE, JSON_LITERAL_NULL, JSON_LITERAL_TRUE, JSON_OBJECT_END, JSON_OBJECT_START, JSON_PAIR_SEPARATOR, JSON_STRING_DELIMITER, JSON_STRING_ESCAPE
 
Fields inherited from interface org.pf.text.StringFilter
ALL, NONE
 
Constructor Summary
StringFilterCollection()
          Initialize the new instance with default values.
 
Method Summary
 void add(StringFilter aFilter)
          Adds the given filter to the collection of filter patterns, if it is not yet there
 StringFilterCollection copy()
          Returns a copy of the filter collection that contains copies of all the defined string filters.
 StringFilter getFilterAt(int index)
           
 StringFilter[] getFilters()
          Returns all contained filters
 boolean isEqual(StringFilterCollection otherFilter)
          Returns true if the given filter collection contains exactly the same filters as this one.
 boolean remove(StringFilter aFilter)
          Removes the given filter from the collection if it exists
 void reset()
          Removes all patterns and starts with a new empty collection.
 void setFilterAt(int index, StringFilter filter)
           
 java.lang.String toString()
           
 
Methods inherited from class org.pf.text.StringPatternCollection
add, add, addPatterns, addPatterns, addPatterns, addPatterns, addPatterns, appendAsJSONString, create, create, getPatternStrings, isEmpty, matches, matchesAll, matchesAny, matchesNone, reject, reject, remove, select, select, setIgnoreCase, size, toJSON
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringFilterCollection

public StringFilterCollection()
Initialize the new instance with default values.

Method Detail

add

public void add(StringFilter aFilter)
Adds the given filter to the collection of filter patterns, if it is not yet there

Parameters:
aFilter - The pattern to add

remove

public boolean remove(StringFilter aFilter)
Removes the given filter from the collection if it exists


getFilters

public StringFilter[] getFilters()
Returns all contained filters


getFilterAt

public StringFilter getFilterAt(int index)

setFilterAt

public void setFilterAt(int index,
                        StringFilter filter)

reset

public void reset()
Removes all patterns and starts with a new empty collection.

Overrides:
reset in class org.pf.text.StringPatternCollection

copy

public StringFilterCollection copy()
Returns a copy of the filter collection that contains copies of all the defined string filters.

Overrides:
copy in class org.pf.text.StringPatternCollection

isEqual

public boolean isEqual(StringFilterCollection otherFilter)
Returns true if the given filter collection contains exactly the same filters as this one.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object