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

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

public class MatchRoleConstraint
extends java.lang.Object
implements RoleConstraint

The Class MatchRoleConstraint is an implementation of the RoleConstraint that uses a given Entity matcher and an entity to check if the new entity can match the original entity.

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

Constructor Summary
MatchRoleConstraint(EntityMatcher entityMatcher, Entity original)
          Instantiates a new match 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

MatchRoleConstraint

public MatchRoleConstraint(EntityMatcher entityMatcher,
                           Entity original)
Instantiates a new match role constraint. It receives an entity matcher and the entity that will be compared to all the new entities

Parameters:
entityMatcher - the entity matcher
original - the original entity
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