org.schmant.project.filter
Class ProjectNameRegexpFilter

java.lang.Object
  extended by org.entityfs.support.filter.AbstractConvenientFilter<Project>
      extended by org.schmant.project.filter.ProjectNameRegexpFilter
All Implemented Interfaces:
Cloneable, ConvenientFilter<Project>, Filter<Project>, ProjectFilter

public final class ProjectNameRegexpFilter
extends AbstractConvenientFilter<Project>
implements ProjectFilter

A ProjectFilter that matches projects against a Java regular expression Pattern.

Since:
0.5
Author:
Karl Gustafsson
See Also:
ProjectNameGlobFilter

Constructor Summary
ProjectNameRegexpFilter(Pattern p)
          Create a case sensitive filter that matches project names against the provided pattern.
ProjectNameRegexpFilter(String pattern)
          Create a case sensitive filter that matches project names against the provided pattern.
ProjectNameRegexpFilter(String pattern, boolean caseSensitive)
          Create a filter that matches project names against the provided pattern.
ProjectNameRegexpFilter(String pattern, int patternFlags)
          Create a filter using the specified pattern and the specified java.util.regex.Pattern flags.
 
Method Summary
 boolean matches(Project p)
          Does the filter match the object?
 
Methods inherited from class org.entityfs.support.filter.AbstractConvenientFilter
and, bitwiseNegate, isCase, not, or, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectNameRegexpFilter

public ProjectNameRegexpFilter(Pattern p)
Create a case sensitive filter that matches project names against the provided pattern.

Parameters:
p - The pattern.

ProjectNameRegexpFilter

public ProjectNameRegexpFilter(String pattern)
Create a case sensitive filter that matches project names against the provided pattern.

Parameters:
pattern - The pattern.

ProjectNameRegexpFilter

public ProjectNameRegexpFilter(String pattern,
                               boolean caseSensitive)
Create a filter that matches project names against the provided pattern.

Parameters:
pattern - The pattern.
caseSensitive - Should the filter be case sensitive?

ProjectNameRegexpFilter

public ProjectNameRegexpFilter(String pattern,
                               int patternFlags)
Create a filter using the specified pattern and the specified java.util.regex.Pattern flags.

Parameters:
pattern - The pattern.
patternFlags - Flags to the pattern compiler.
Method Detail

matches

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

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