org.jscience.computing.ai.planning
Class LogicalExpression

java.lang.Object
  extended by org.jscience.computing.ai.planning.CompileTimeObject
      extended by org.jscience.computing.ai.planning.LogicalExpression
Direct Known Subclasses:
LogicalExpressionAssignment, LogicalExpressionAtomic, LogicalExpressionCall, LogicalExpressionConjunction, LogicalExpressionDisjunction, LogicalExpressionForAll, LogicalExpressionNegation, LogicalExpressionNil

public abstract class LogicalExpression
extends CompileTimeObject

Each logical expression at compile time is represented as a class derived from this abstract class.


Constructor Summary
LogicalExpression()
           
 
Method Summary
 int getClassCnt()
          This function returns a unique integer every time called.
abstract  java.lang.String getInitCode()
          This function produces Java code that initializes some data structures that will be needed to create the precondition object that implements this logical expression at run time.
 int getVarCount()
          This function returns the number of variables in this logical expression.
protected abstract  void propagateVarCount(int varCountIn)
          This abstract function is called whenever the number of variables for an object of this class is set.
 void setVarCount(int varCountIn)
          This function is used to set the number of variables for this logical expression.
 
Methods inherited from class org.jscience.computing.ai.planning.CompileTimeObject
toCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicalExpression

public LogicalExpression()
Method Detail

getClassCnt

public int getClassCnt()
This function returns a unique integer every time called. This unique integer is used at compile time to make names of classes that implement preconditions at run time unique.

Returns:
the unique integer.

getInitCode

public abstract java.lang.String getInitCode()
This function produces Java code that initializes some data structures that will be needed to create the precondition object that implements this logical expression at run time.

Returns:
the produced code as a String.

getVarCount

public int getVarCount()
This function returns the number of variables in this logical expression.

Returns:
the number of variables in this logical expression.

propagateVarCount

protected abstract void propagateVarCount(int varCountIn)
This abstract function is called whenever the number of variables for an object of this class is set. Classes that extend this class should implement this function accordingly in order to update their own data structures where they hold this information.

Parameters:
varCountIn - the number of variables for this logical expression.

setVarCount

public void setVarCount(int varCountIn)
This function is used to set the number of variables for this logical expression.

Parameters:
varCountIn - the number of variables for this logical expression.