jcreek.representation.constraints
Class CardinalityConstraint

java.lang.Object
  extended byjcreek.representation.constraints.Constraint
      extended byjcreek.representation.constraints.CardinalityConstraint

public class CardinalityConstraint
extends Constraint

Offers the ability from define cardinality constraints for the relations of a given type for some entity. Two integer values, max and min defines the maximum and minimum cardinality.

Author:
Martin Stige

Field Summary
 
Fields inherited from class jcreek.representation.constraints.Constraint
constraintData, knowledgeModel
 
Constructor Summary
CardinalityConstraint(KnowledgeModel knowledgeModel, ConstraintData constraintData)
          Creates a new instance of CardinalityConstraint from a constraint data object
CardinalityConstraint(KnowledgeModel knowledgeModel, RelationType rel, int numberMin, int numberMax, java.lang.String description)
          Creates a new instance of CardinalityConstraint
 
Method Summary
 int getMax()
          Returns the maximum cardinality constraint
 int getMin()
          Returns the minimum cardinality constraint
 void setMax(int max)
          Sets the maximum cardinality value
 void setMin(int min)
          Sets the minimum cardinality value
 
Methods inherited from class jcreek.representation.constraints.Constraint
check, equals, getConstraintData, getDescription, getID, getRelation, setDescription, setKnowledgeModel, setRelation, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CardinalityConstraint

public CardinalityConstraint(KnowledgeModel knowledgeModel,
                             RelationType rel,
                             int numberMin,
                             int numberMax,
                             java.lang.String description)
Creates a new instance of CardinalityConstraint

Parameters:
knowledgeModel - the knowledge model
rel - the relation to be constrained
numberMin - the minimum cardinality
numberMax - the maximum cardinality
description - description of the constraint

CardinalityConstraint

public CardinalityConstraint(KnowledgeModel knowledgeModel,
                             ConstraintData constraintData)
Creates a new instance of CardinalityConstraint from a constraint data object

Parameters:
knowledgeModel - the knowledge model
constraintData - the constraint data to be contained in the constraint
Method Detail

setMin

public void setMin(int min)
Sets the minimum cardinality value

Parameters:
min - the minimum cardinality

setMax

public void setMax(int max)
Sets the maximum cardinality value

Parameters:
max - the maximum cardinality

getMin

public int getMin()
Returns the minimum cardinality constraint


getMax

public int getMax()
Returns the maximum cardinality constraint



Created at IDI, NTNU by the Artificial Intelligence and Learning group