JSHOP2
Class LogicalPrecondition

java.lang.Object
  extended by JSHOP2.CompileTimeObject
      extended by JSHOP2.LogicalPrecondition

public class LogicalPrecondition
extends CompileTimeObject

Each logical precondition 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  boolean first
          Whether or not this logical precondition is marked :first.
private  java.lang.String func
          The name of the function used in a :sort-by logical precondition.
private  LogicalExpression le
          The logical expression this class represents.
 
Fields inherited from class JSHOP2.CompileTimeObject
endl
 
Constructor Summary
LogicalPrecondition(LogicalExpression leIn, boolean firstIn)
          To initialize this logical precondition.
LogicalPrecondition(LogicalExpression leIn, java.lang.String funcIn)
          To initialize this logical precondition.
 
Method Summary
 boolean getFirst()
          To check whether or not this logical precondition is marked :first.
 java.lang.String getInitCode()
          This function produces Java code that implements the class any object of which can be used at run time to represent this logical precondition.
 void setVarCount(int varCount)
          This function is used to set the number of variables for this logical precondition.
 java.lang.String toCode()
          This function produces the Java code to create an object that represents this logical precondition at run time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

private boolean first
Whether or not this logical precondition is marked :first.


func

private java.lang.String func
The name of the function used in a :sort-by logical precondition.


le

private LogicalExpression le
The logical expression this class represents.

Constructor Detail

LogicalPrecondition

public LogicalPrecondition(LogicalExpression leIn,
                           boolean firstIn)
To initialize this logical precondition.

Parameters:
leIn - the logical expression this class represents.
firstIn - whether or not this logical precondition is marked :first.

LogicalPrecondition

public LogicalPrecondition(LogicalExpression leIn,
                           java.lang.String funcIn)
To initialize this logical precondition.

Parameters:
leIn - the logical expression this class represents.
funcIn - the name of the function used in a :sort-by logical precondition.
Method Detail

getFirst

public boolean getFirst()
To check whether or not this logical precondition is marked :first.

Returns:
true if this logical precondition is marked :first, false otherwise.

getInitCode

public java.lang.String getInitCode()
This function produces Java code that implements the class any object of which can be used at run time to represent this logical precondition.


setVarCount

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

Parameters:
varCount - the number of variables for this logical precondition.

toCode

public java.lang.String toCode()
This function produces the Java code to create an object that represents this logical precondition at run time.

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