edu.columbia.cs.ref.model.constraint.role
Interface RoleConstraint

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AndRoleConstraint, EntityTypeConstraint, IsOptionalConstraint, MatchRoleConstraint, NoConstraint, OrRoleConstraint

public interface RoleConstraint
extends java.io.Serializable

The Interface RoleConstraint represents a constraint over a given role of a relationship.

Instances of classes that implement this interface can be used in two different ways:

1) by using the checkConstraint method, it can check if a given entity fulfills the constraint

2) by using the getCompatibleEntities method, it can filter entities taht do not fulfill the constraint

Since:
2011-09-27
Version:
0.1
Author:
Pablo Barrio, Goncalo Simoes

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
 

Method Detail

checkConstraint

boolean checkConstraint(Entity role)
Check check if the input entity fulfills the constraint

Parameters:
role - the entity
Returns:
true, if successful

getCompatibleEntities

java.util.Set<Entity> getCompatibleEntities(java.util.Set<Entity> entities)
Returns the subset of all the input entities that fulfill the constraint

Parameters:
entities - the entities to be checked
Returns:
the compatible entities