org.gcube.data.trees.constraints
Class Match

java.lang.Object
  extended by org.gcube.data.trees.constraints.BaseConstraint<Object>
      extended by org.gcube.data.trees.constraints.Match
All Implemented Interfaces:
Serializable, Constraint<Object>

public class Match
extends BaseConstraint<Object>

Accepts values that match a given regular expression when converted to String.

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
Match(String regex)
          Creates an instance from a regular expression.
 
Method Summary
 boolean accepts(Object o)
          Returns true if a value satisfies the constraint.
 boolean equals(Object obj)
          
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Match

public Match(String regex)
Creates an instance from a regular expression.

Parameters:
regex - the regular expression
Method Detail

accepts

public boolean accepts(Object o)
Returns true if a value satisfies the constraint.

Parameters:
o - the value.
Returns:
true if the value satisfies the constraint, false if it does not.

toString

public String toString()

Overrides:
toString in class BaseConstraint<Object>

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2012. All Rights Reserved.