JSHOP2
Class LogicalExpressionConjunction

java.lang.Object
  extended by JSHOP2.CompileTimeObject
      extended by JSHOP2.LogicalExpression
          extended by JSHOP2.LogicalExpressionConjunction

public class LogicalExpressionConjunction
extends LogicalExpression

Each conjunction at compile time is represented as an instance of this class.

Version:
1.0.3
Author:
Okhtay Ilghami, http://www.cs.umd.edu/~okhtay

Field Summary
private  int cnt
          The number of objects instantiated from this class before this object was instantiated.
private  LogicalExpression[] le
          An array of logical expressions the conjunction of which is represented by this object.
 
Fields inherited from class JSHOP2.CompileTimeObject
endl
 
Constructor Summary
LogicalExpressionConjunction(java.util.Vector<LogicalExpression> leIn)
          To initialize this conjunction.
 
Method Summary
 java.lang.String getInitCode()
          This function produces Java code that implements the classes any object of which can be used at run time to represent the conjuncts of this conjunction, and the conjunction itself.
private  java.lang.String getInitCodeNext()
          This function produces Java code that implements the nextBindingHelper function for the precondition object that represents this conjunction at run time.
private  java.lang.String getInitCodeReset()
          This function produces Java code that implements the resetHelper function for the precondtion object that represents this conjunction at run time.
protected  void propagateVarCount(int varCount)
          To propagate the variable count to all the logical expressions the conjunction of which this object represents.
 java.lang.String toCode()
          This function produces the Java code to create an object of the class that was implemented to represent this conjunction at run time.
 
Methods inherited from class JSHOP2.LogicalExpression
getClassCnt, getVarCount, setVarCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cnt

private int cnt
The number of objects instantiated from this class before this object was instantiated. Used to make the name of the precondition class that implements this conjunction unique.


le

private LogicalExpression[] le
An array of logical expressions the conjunction of which is represented by this object.

Constructor Detail

LogicalExpressionConjunction

public LogicalExpressionConjunction(java.util.Vector<LogicalExpression> leIn)
To initialize this conjunction.

Parameters:
leIn - a Vector of logical expressions the conjunction of which is represented by this object. Note that we use a Vector rather than an array since at compile time we do not know how many conjuncts there are in this particular conjunction.
Method Detail

getInitCode

public java.lang.String getInitCode()
This function produces Java code that implements the classes any object of which can be used at run time to represent the conjuncts of this conjunction, and the conjunction itself.

Specified by:
getInitCode in class LogicalExpression
Returns:
the produced code as a String.

getInitCodeNext

private java.lang.String getInitCodeNext()
This function produces Java code that implements the nextBindingHelper function for the precondition object that represents this conjunction at run time.

Returns:
the produced code as a String.

getInitCodeReset

private java.lang.String getInitCodeReset()
This function produces Java code that implements the resetHelper function for the precondtion object that represents this conjunction at run time.

Returns:
the produced code as a String.

propagateVarCount

protected void propagateVarCount(int varCount)
To propagate the variable count to all the logical expressions the conjunction of which this object represents.

Specified by:
propagateVarCount in class LogicalExpression
Parameters:
varCount - the number of variables for this logical expression.

toCode

public java.lang.String toCode()
This function produces the Java code to create an object of the class that was implemented to represent this conjunction at run time.

Specified by:
toCode in class CompileTimeObject
Returns:
the produced code as a String.