jcreek.representation.constraints
Class GeneralConstraintObject

java.lang.Object
  extended byjcreek.representation.constraints.ConstraintObject
      extended byjcreek.representation.constraints.GeneralConstraintObject
All Implemented Interfaces:
java.io.Serializable

public class GeneralConstraintObject
extends ConstraintObject

Handles the behaviour of general constraints.

Offers the ability to define arbitrary complex constraints written i Java.

Author:
Martin Stige
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jcreek.representation.constraints.ConstraintObject
km, rel
 
Constructor Summary
GeneralConstraintObject(java.lang.String constraintString)
          Creates a new instance of GeneralConstraintObject
 
Method Summary
 ConstraintCheckResult check(Entity from)
          Checks the constraint on an entity
protected  java.lang.String getConstraintString()
          Returs the constraint string
 Constraint newConstraintInstance(KnowledgeModel km, ConstraintData data)
          Creates a new constraint object of this type
protected  void setConstraintString(java.lang.String constraintString)
          Sets the constraint string (source code)
 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

GeneralConstraintObject

public GeneralConstraintObject(java.lang.String constraintString)
Creates a new instance of GeneralConstraintObject

Parameters:
constraintString - the source code string
Method Detail

check

public ConstraintCheckResult check(Entity from)
Checks the constraint on an entity

Specified by:
check in class ConstraintObject
Parameters:
from - the entity to check with this constraint
Returns:
true if everyting is ok, false if the constraint is violated

newConstraintInstance

public Constraint newConstraintInstance(KnowledgeModel km,
                                        ConstraintData data)
Creates a new constraint object of this type

Specified by:
newConstraintInstance in class ConstraintObject
Parameters:
km - the knowledge model
data - the constraint data object to be contained in the constraint

getConstraintString

protected java.lang.String getConstraintString()
Returs the constraint string


setConstraintString

protected void setConstraintString(java.lang.String constraintString)
Sets the constraint string (source code)

Parameters:
constraintString - the source code

toString

public java.lang.String toString()
Specified by:
toString in class ConstraintObject


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