jcreek.representation.constraints
Class ConcreteValueConstraint

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

public class ConcreteValueConstraint
extends Constraint

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.

Author:
Martin Stige

Field Summary
 
Fields inherited from class jcreek.representation.constraints.Constraint
constraintData, knowledgeModel
 
Constructor Summary
ConcreteValueConstraint(KnowledgeModel knowledgeModel, ConstraintData constraintData)
          Creates a new instance of ConcreteValueConstraint
ConcreteValueConstraint(KnowledgeModel knowledgeModel, RelationType rel, java.util.ArrayList values, boolean allowed, java.lang.String description)
          Creates a new instance of ConcreteValueConstraint
 
Method Summary
 boolean getAllowed()
          Returns whether the values are allowed or disallowed
 java.util.ArrayList getValues()
          Returns the list of allowed or disallowed values
 void setAllowed(boolean b)
          Sets whether the values are allowed or disallowed
 void setValues(java.util.ArrayList al)
          Sets the values that are either allowed or disallowed
 
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

ConcreteValueConstraint

public ConcreteValueConstraint(KnowledgeModel knowledgeModel,
                               RelationType rel,
                               java.util.ArrayList values,
                               boolean allowed,
                               java.lang.String description)
Creates a new instance of ConcreteValueConstraint

Parameters:
knowledgeModel - the knowledge model the constraint shall bellong to
rel - the relation type the constraint shall constrain
values - the concrete values to be allowed or not
allowed - whether the values shall be allowed or not
description - a description of the constraint

ConcreteValueConstraint

public ConcreteValueConstraint(KnowledgeModel knowledgeModel,
                               ConstraintData constraintData)
Creates a new instance of ConcreteValueConstraint

Parameters:
knowledgeModel - the knowledge model the constraint shall bellong to
constraintData - the constraint data to be contained by the constraint
Method Detail

setValues

public void setValues(java.util.ArrayList al)
Sets the values that are either allowed or disallowed

Parameters:
al - the list of values

setAllowed

public void setAllowed(boolean b)
Sets whether the values are allowed or disallowed

Parameters:
b - allowed or not

getValues

public java.util.ArrayList getValues()
Returns the list of allowed or disallowed values


getAllowed

public boolean getAllowed()
Returns whether the values are allowed or disallowed



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