bibliothek.util.filter
Class RegexFilter

java.lang.Object
  extended by bibliothek.util.filter.RegexFilter
All Implemented Interfaces:
Filter<String>

public class RegexFilter
extends Object
implements Filter<String>

This filter uses regular expressions to filter a String.

Author:
Benjamin Sigg
See Also:
String.matches(String)

Constructor Summary
RegexFilter(String regex)
          Creates a new filter.
 
Method Summary
 boolean includes(String item)
          Tells whether the item item should be included or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexFilter

public RegexFilter(String regex)
Creates a new filter.

Parameters:
regex - the regular expression which filters the Strings
Method Detail

includes

public boolean includes(String item)
Description copied from interface: Filter
Tells whether the item item should be included or not.

Specified by:
includes in interface Filter<String>
Parameters:
item - the item to include, depending on the user of this filter the item may or may not be null
Returns:
true if item is included, false if item is excluded