edu.columbia.cs.ref.model.constraint.role.impl
Class OrRoleConstraint

java.lang.Object
  extended by edu.columbia.cs.ref.model.constraint.role.impl.OrRoleConstraint
All Implemented Interfaces:
RoleConstraint, java.io.Serializable

public class OrRoleConstraint
extends java.lang.Object
implements RoleConstraint

The Class OrRoleConstraint is an implementation of RoleConstraint that is used to compose several other constraints. This constraint checks if at least one of the constraints passed as input to the constructor checks

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

Constructor Summary
OrRoleConstraint(RoleConstraint... constraints)
          Instantiates a new or role constraint.
 
Method Summary
 boolean checkConstraint(Entity role)
          Check check if the input entity fulfills the constraint
 java.util.Set<Entity> getCompatibleEntities(java.util.Set<Entity> entities)
          Returns the subset of all the input entities that fulfill the constraint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrRoleConstraint

public OrRoleConstraint(RoleConstraint... constraints)
Instantiates a new or role constraint. It receives an undefined number of contraints that must be checked.

Parameters:
constraints - the constraints
Method Detail

checkConstraint

public boolean checkConstraint(Entity role)
Description copied from interface: RoleConstraint
Check check if the input entity fulfills the constraint

Specified by:
checkConstraint in interface RoleConstraint
Parameters:
role - the entity
Returns:
true, if successful

getCompatibleEntities

public java.util.Set<Entity> getCompatibleEntities(java.util.Set<Entity> entities)
Description copied from interface: RoleConstraint
Returns the subset of all the input entities that fulfill the constraint

Specified by:
getCompatibleEntities in interface RoleConstraint
Parameters:
entities - the entities to be checked
Returns:
the compatible entities