jcreek.representation.constraints
Class ValueRangeConstraint

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

public class ValueRangeConstraint
extends Constraint

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

Author:
Martin Stige

Field Summary
 
Fields inherited from class jcreek.representation.constraints.Constraint
constraintData, knowledgeModel
 
Constructor Summary
ValueRangeConstraint(KnowledgeModel knowledgeModel, ConstraintData constraintData)
           
ValueRangeConstraint(KnowledgeModel knowledgeModel, RelationType rel, java.lang.Number numberMin, java.lang.Number numberMax, boolean allowed, java.lang.String description)
          Creates a new instance of ValueRangeConsraint
 
Method Summary
 boolean getAllowed()
          Returns whether the range are allowed or not
 java.lang.Number getMax()
          Returns the maximum number of the range
 java.lang.Number getMin()
          Returns the minimum number of the range
 void setAllowed(boolean b)
          Sets whether the value range shall be the allowed values or disallowed values.
 void setMax(java.lang.Number max)
          Sets the maximum number of the range
 void setMin(java.lang.Number min)
          Sets the minimum number of the range
 
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

ValueRangeConstraint

public ValueRangeConstraint(KnowledgeModel knowledgeModel,
                            RelationType rel,
                            java.lang.Number numberMin,
                            java.lang.Number numberMax,
                            boolean allowed,
                            java.lang.String description)
Creates a new instance of ValueRangeConsraint


ValueRangeConstraint

public ValueRangeConstraint(KnowledgeModel knowledgeModel,
                            ConstraintData constraintData)
Method Detail

setAllowed

public void setAllowed(boolean b)
Sets whether the value range shall be the allowed values or disallowed values.

Parameters:
b - allowed or not

getAllowed

public boolean getAllowed()
Returns whether the range are allowed or not


setMin

public void setMin(java.lang.Number min)
Sets the minimum number of the range

Parameters:
min - the minimum value

getMin

public java.lang.Number getMin()
Returns the minimum number of the range


setMax

public void setMax(java.lang.Number max)
Sets the maximum number of the range

Parameters:
max - the maximum value

getMax

public java.lang.Number getMax()
Returns the maximum number of the range



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