|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.representation.constraints.ConstraintObject
jcreek.representation.constraints.CardinalityConstraintObject
Handles the behaviour of Cardinality constraints.
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.
Field Summary |
Fields inherited from class jcreek.representation.constraints.ConstraintObject |
km, rel |
Constructor Summary | |
CardinalityConstraintObject(RelationType rel,
int numberMin,
int numberMax)
Creates a new instance of Cardinality The entity from must have minimum numberMin
and maximum numberMax values for the slot/relation
rel |
Method Summary | |
ConstraintCheckResult |
check(Entity from)
Checks whether the constraint is violated or not. |
protected int |
getMax()
Returns the max cardinality |
protected int |
getMin()
Returns the min cardinality |
Constraint |
newConstraintInstance(KnowledgeModel km,
ConstraintData data)
Creates a Cardinality constraint object |
protected void |
setMax(int m)
Sets the max cardinality |
protected void |
setMin(int m)
Sets the min cardinality |
java.lang.String |
toString()
|
Methods inherited from class jcreek.representation.constraints.ConstraintObject |
getRelation, setKnowledgeModel, setRelation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CardinalityConstraintObject(RelationType rel, int numberMin, int numberMax)
The entity from
must have minimum numberMin
and maximum numberMax
values for the slot/relation
rel
rel
- the RelationType being constraindnumberMin
- the minimum number of valuesnumberMax
- the maximum number of valuesMethod Detail |
public ConstraintCheckResult check(Entity from)
ConstraintObject
Should be augmented to offer some feedback about the violations. Until that is made, feedback is just printed to System.out.
check
in class ConstraintObject
public java.lang.String toString()
toString
in class ConstraintObject
protected int getMax()
protected int getMin()
protected void setMax(int m)
m
- the max cardinality valueprotected void setMin(int m)
m
- the min cardinality valuepublic Constraint newConstraintInstance(KnowledgeModel km, ConstraintData data)
newConstraintInstance
in class ConstraintObject
km
- the knowledge modeldata
- the constraint object to be contained by the constraint
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |