org.entityfs.util.filter.regexp
Class EntityNameRegexpFilter

java.lang.Object
  extended by org.entityfs.support.filter.AbstractConvenientFilter<EntityView>
      extended by org.entityfs.util.filter.regexp.EntityNameRegexpFilter
All Implemented Interfaces:
Cloneable, EntityFilter, ConvenientFilter<EntityView>, Filter<EntityView>

public class EntityNameRegexpFilter
extends AbstractConvenientFilter<EntityView>
implements EntityFilter

This is a Filter that matches entity names against a regular expression Pattern.

Instances of this class are immutable.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-util

Constructor Summary
EntityNameRegexpFilter(Pattern pattern)
          Create a filter.
EntityNameRegexpFilter(String pattern)
          Create a case sensitive filter.
EntityNameRegexpFilter(String pattern, boolean caseSensitive)
          Create a filter.
EntityNameRegexpFilter(String pattern, int flags)
          Create a filter.
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 boolean matches(EntityView ev)
          Does the filter match the object?
 String toString()
           
 
Methods inherited from class org.entityfs.support.filter.AbstractConvenientFilter
and, bitwiseNegate, isCase, not, or, xor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityNameRegexpFilter

public EntityNameRegexpFilter(Pattern pattern)
Create a filter.

Parameters:
pattern - The pattern to match entity names against.

EntityNameRegexpFilter

public EntityNameRegexpFilter(String pattern)
                       throws PatternSyntaxException
Create a case sensitive filter.

Parameters:
pattern - A regular expression pattern.
Throws:
PatternSyntaxException - On syntax errors in the pattern.

EntityNameRegexpFilter

public EntityNameRegexpFilter(String pattern,
                              boolean caseSensitive)
                       throws PatternSyntaxException
Create a filter.

Parameters:
pattern - A regular expression pattern.
caseSensitive - Should the filter be case sensitive?
Throws:
PatternSyntaxException - On syntax errors in the pattern.

EntityNameRegexpFilter

public EntityNameRegexpFilter(String pattern,
                              int flags)
                       throws PatternSyntaxException
Create a filter.

Parameters:
pattern - A regular expression pattern.
flags - Flags to Pattern.compile.
Throws:
PatternSyntaxException - On syntax errors in the pattern.
Method Detail

matches

public boolean matches(EntityView ev)
Description copied from interface: Filter
Does the filter match the object?

Specified by:
matches in interface Filter<EntityView>
Parameters:
ev - The object to match.
Returns:
true if the filter matches the object.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object