net.sf.staccatocommons.lang.predicate.internal
Class Matches

java.lang.Object
  extended by net.sf.staccatocommons.lang.predicate.AbstractPredicate<T>
      extended by net.sf.staccatocommons.lang.predicate.internal.TopLevelPredicate<String>
          extended by net.sf.staccatocommons.lang.predicate.internal.Matches
All Implemented Interfaces:
Serializable, net.sf.staccatocommons.defs.Applicable<String,Boolean>, net.sf.staccatocommons.defs.Evaluable<String>, net.sf.staccatocommons.defs.predicate.Predicate<String>

public class Matches
extends TopLevelPredicate<String>

A Predicate that evaluates if a String mathes a Pattern

Author:
flbulgarelli
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.staccatocommons.lang.predicate.AbstractPredicate
AbstractPredicate.Soft<A>
 
Constructor Summary
Matches(Pattern pattern)
          Creates a new Matches using a Pattern.
Matches(String regexp)
          Creates a new Matches using a regular expression
 
Method Summary
 boolean eval(String input)
           
 
Methods inherited from class net.sf.staccatocommons.lang.predicate.internal.TopLevelPredicate
toString
 
Methods inherited from class net.sf.staccatocommons.lang.predicate.AbstractPredicate
and, andNotNull, apply, not, of, or, orNull, withEffectOnFalse, withEffectOnTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matches

public Matches(String regexp)
Creates a new Matches using a regular expression

Parameters:
regexp - the regular expression. Non null.

Matches

public Matches(Pattern pattern)
Creates a new Matches using a Pattern.

Parameters:
pattern - the pattern. Non null
Method Detail

eval

public boolean eval(@NonNull
                    String input)
Specified by:
eval in interface net.sf.staccatocommons.defs.Evaluable<String>
Specified by:
eval in class AbstractPredicate<String>


Copyright © 2010-2012 Staccatocommons. All Rights Reserved.