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

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

public class DistanceBetweenEntitiesConstraint
extends java.lang.Object
implements RelationshipConstraint

The Class DistanceBetweenEntitiesConstraint is an implementation of RelationshipConstraint that checks if the number of characters between entities is less than a given value passed to the constructor.

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

Constructor Summary
DistanceBetweenEntitiesConstraint(int k)
          Instantiates a new distance between entities constraint.
DistanceBetweenEntitiesConstraint(java.lang.Integer k)
          Instantiates a new distance between entities constraint.
 
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

DistanceBetweenEntitiesConstraint

public DistanceBetweenEntitiesConstraint(int k)
Instantiates a new distance between entities constraint. The parameter is the maximum allowed distance between the entities.

Parameters:
k - the k

DistanceBetweenEntitiesConstraint

public DistanceBetweenEntitiesConstraint(java.lang.Integer k)
Instantiates a new distance between entities constraint. The parameter is the maximum allowed distance between the entities.

Parameters:
k - the k
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