|
|||||||||||
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.ConcreteValueConstraintObject
Handles the behaviour of Concrete value constraints.
Offers the ability to define constraints based on concrete values. You can either define the closed set of allowed values, or define a set of values that are not allowed.
It is not interresting to define both these two constraints on the same
entity->relation. If the (positive) allowed is used, all values not
on the list are implicitly defined as disallowed.
If the (negative) disallowed is used all values not on the list are allowed.
Field Summary |
Fields inherited from class jcreek.representation.constraints.ConstraintObject |
km, rel |
Constructor Summary | |
ConcreteValueConstraintObject(RelationType rel,
java.util.ArrayList values,
boolean allowed)
Creates a new instance of ConcreteValueConstraintObject Defines a list of values/entities that are either allowed or dissallowed as a value for a relation on an entity. |
Method Summary | |
protected void |
addValue(Entity val)
Adds a new value to the allowed/dissallowed list |
ConstraintCheckResult |
check(Entity from)
Checks the constraint |
protected boolean |
getAllowed()
Returns whether the values are allowed or not true = allowed, false = disallowed |
protected java.util.ArrayList |
getValues()
Returns the values that are allowed or disallowed |
Constraint |
newConstraintInstance(KnowledgeModel km,
ConstraintData data)
Creates a ConcretValueConstraint object from a ConstraintData object |
protected void |
setAllowed(boolean b)
Sets wheter the list of values are allowed or not |
protected void |
setValues(java.util.ArrayList a)
Sets the list of values |
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 ConcreteValueConstraintObject(RelationType rel, java.util.ArrayList values, boolean allowed)
Meaning of constraint: The values in the list are allowed/dissallowed as the values of relations of type rel from entity from
rel
- the relation type being restrictedvalues
- the values allowed or dissallowedallowed
- descides whether the values are allowed or dissallowedMethod Detail |
protected void addValue(Entity val)
val
- the value to be addedpublic ConstraintCheckResult check(Entity from)
check
in class ConstraintObject
from
- the entity that are constrained
protected java.util.ArrayList getValues()
protected boolean getAllowed()
protected void setValues(java.util.ArrayList a)
a
- the list of valuesprotected void setAllowed(boolean b)
public Constraint newConstraintInstance(KnowledgeModel km, ConstraintData data)
newConstraintInstance
in class ConstraintObject
km
- the knowledge modeldata
- the constraint data to be contained by the constraintpublic java.lang.String toString()
toString
in class ConstraintObject
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |