edu.columbia.cs.ref.model.constraint.relationship.impl
Class AndRelationshipConstraint

java.lang.Object
  extended by edu.columbia.cs.ref.model.constraint.relationship.impl.AndRelationshipConstraint
All Implemented Interfaces:
RelationshipConstraint, java.io.Serializable

public class AndRelationshipConstraint
extends java.lang.Object
implements RelationshipConstraint

The Class AndRelationshipConstraint is an implementation of RelationshipConstraint that is used to compose several other constraints. This constraint checks if all the constraints passed as input to the constructor check

Since:
2011-09-27
Version:
0.1
Author:
Pablo Barrio, Goncalo Simoes
See Also:
Serialized Form

Constructor Summary
AndRelationshipConstraint(RelationshipConstraint... constraints)
          Instantiates a new AndRelationshipConstraint.
 
Method Summary
 boolean checkConstraint(Relationship rel)
          Checks if the relationship constraint is fulfilled on the input relationship.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndRelationshipConstraint

public AndRelationshipConstraint(RelationshipConstraint... constraints)
Instantiates a new AndRelationshipConstraint. It receives an undefined number of contraints that must be checked.

Parameters:
constraints - the constraints
Method Detail

checkConstraint

public boolean checkConstraint(Relationship rel)
Description copied from interface: RelationshipConstraint
Checks if the relationship constraint is fulfilled on the input relationship.

Specified by:
checkConstraint in interface RelationshipConstraint
Parameters:
rel - the relationship where the constraint is to be checked
Returns:
true, if successful