|
|||||||||||
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.ValueRangeConstraintObject
Handles the behaviour of Value range constraints
. Offers the ability to constrain the value of nummerical slots. You can either define an allowed range of values or a range that is not allowed
Field Summary |
Fields inherited from class jcreek.representation.constraints.ConstraintObject |
km, rel |
Constructor Summary | |
ValueRangeConstraintObject(RelationType rel,
java.lang.Number valueMin,
java.lang.Number valueMax,
boolean allowed)
Creates a new instance of ValueRangeConstraint Constrains the values of relations pointing to nummerical values. |
Method Summary | |
ConstraintCheckResult |
check(Entity from)
Checks whether the constraint is violated or not. |
protected boolean |
getAllowed()
|
protected java.lang.Number |
getMax()
|
protected java.lang.Number |
getMin()
|
Constraint |
newConstraintInstance(KnowledgeModel km,
ConstraintData data)
Creates a Constraint object of a specific type |
protected void |
setAllowed(boolean b)
|
protected void |
setMax(java.lang.Number n)
|
protected void |
setMin(java.lang.Number n)
|
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 ValueRangeConstraintObject(RelationType rel, java.lang.Number valueMin, java.lang.Number valueMax, boolean allowed)
Constrains the values of relations pointing to nummerical values. You can either define an allowed or disallowed range of values.
rel
- the RelationType being constraindvalueMin
- the minimum number of valuesvalueMax
- the maximum number of valuesallowed
- whether the range (valueMax - valueMin) is allowed or disallowedMethod 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 Constraint newConstraintInstance(KnowledgeModel km, ConstraintData data)
ConstraintObject
newConstraintInstance
in class ConstraintObject
km
- the knowledge model that the constraint shall bellong todata
- the ConstraintData object to be contained by the constriantprotected java.lang.Number getMax()
protected java.lang.Number getMin()
protected boolean getAllowed()
protected void setMax(java.lang.Number n)
protected void setMin(java.lang.Number n)
protected void setAllowed(boolean b)
public java.lang.String toString()
toString
in class ConstraintObject
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |