org.gcube.data.trees.constraints
Class All<T>

java.lang.Object
  extended by org.gcube.data.trees.constraints.BaseConstraint<T>
      extended by org.gcube.data.trees.constraints.All<T>
Type Parameters:
T - the type of the constrained values.
All Implemented Interfaces:
Serializable, Constraint<T>

public class All<T>
extends BaseConstraint<T>

Accepts values that have the same type and satisfy one ore more constraints.

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
All(Constraint<T> c1, Constraint<T> c2)
          Creates an instance from two constraints.
 
Method Summary
 boolean accepts(T t)
          Returns true if a value satisfies the constraint.
 List<Constraint<T>> constraints()
           
 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

All

public All(Constraint<T> c1,
           Constraint<T> c2)
Creates an instance from two constraints.

Parameters:
c1 - the first constraint
c2 - the second constraint
Method Detail

constraints

public List<Constraint<T>> constraints()

accepts

public boolean accepts(T t)
Description copied from interface: Constraint
Returns true if a value satisfies the constraint.

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

toString

public String toString()

Overrides:
toString in class BaseConstraint<T>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2013. All Rights Reserved.