jeops.expressions
Class ActionJavaExpr

java.lang.Object
  |
  +--jeops.expressions.ActionJavaExpr

public class ActionJavaExpr
extends java.lang.Object

This class models an action statement of the inference engine. The possible statements can be simple method calls, variable declaration, assignment or including, removing and modifying objects from the object base.

Version:
0.05 23 May 1999 First version with comments in English; added the modified statement.
Author:
Carlos Figueira Filho (csff@di.ufpe.br)

Field Summary
static int ASSIGN
          Constant used to indicate that an expression type is an assignment.
static int CREATE
          Constant used to indicate that an expression type is an assertion to the object base.
static int DECLAR
          Constant used to indicate that an expression type is a (local) declaration.
static int DELETE
          Constant used to indicate that an expresison type is a deletion of an object to object base.
static int METHOD
          Constant used to indicate that an expression type is a method call.
static int MODIFY
          Constant used to indicate that this expression is a modified statement.
 
Constructor Summary
ActionJavaExpr(int type, JavaExpr expression)
          Class constructor.
ActionJavaExpr(int type, java.lang.String ident, JavaExpr expression)
          Class constructor for assignment statements.
ActionJavaExpr(int type, java.lang.String className, java.lang.String ident, JavaExpr expression)
          Class constructor for declaration statements.
 
Method Summary
 void dump()
          Prints the tree for the expression of this precondition.
 void dump(int spaces)
          Prints the tree for the expression of this precondition.
 java.lang.String getClassName()
          Returns the class name of a locally declared object, if applicable.
 JavaExpr getExpression()
          Returns the expression that will produce the object to be inserted in the object base, or the RHS of the assignment, if applicable.
 java.lang.String getIdent()
          Returns the variable identifier, in case of a method call or the LHS of an assignment.
 java.lang.String getMethodName()
          Returns the name of the method to be invoked, if applicable.
 int getType()
          Returns the type of this expression.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

METHOD

public static final int METHOD
Constant used to indicate that an expression type is a method call.

CREATE

public static final int CREATE
Constant used to indicate that an expression type is an assertion to the object base.

DELETE

public static final int DELETE
Constant used to indicate that an expresison type is a deletion of an object to object base.

ASSIGN

public static final int ASSIGN
Constant used to indicate that an expression type is an assignment.

DECLAR

public static final int DECLAR
Constant used to indicate that an expression type is a (local) declaration.

MODIFY

public static final int MODIFY
Constant used to indicate that this expression is a modified statement.
Since:
0.05
Constructor Detail

ActionJavaExpr

public ActionJavaExpr(int type,
                      java.lang.String className,
                      java.lang.String ident,
                      JavaExpr expression)
Class constructor for declaration statements.
Parameters:
type - the type of this action statement. It must be equals to ActionJavaExpr.DECLAR
className - the class of the object being declared.
ident - the identifier of the object being declared.
expression - the initializer for the object being declared. It can be null.
See Also:
DECLAR

ActionJavaExpr

public ActionJavaExpr(int type,
                      java.lang.String ident,
                      JavaExpr expression)
Class constructor for assignment statements.
Parameters:
type - the type of this action statement. It must be equals to ActionJavaExpr.ATRIB
ident - the identifier of the LHS of the assignment.
expression - the RHS of the assignment.
See Also:
ASSIGN

ActionJavaExpr

public ActionJavaExpr(int type,
                      JavaExpr expression)
Class constructor.
Parameters:
type - the type of this action statement.
expression - the expression that is either being executed, inserted into, removed from or modified in the object base.
See Also:
METHOD, CREATE, DELETE, ASSIGN, DECLAR, MODIFY
Method Detail

dump

public void dump()
Prints the tree for the expression of this precondition. Useful for debugging.

dump

public void dump(int spaces)
Prints the tree for the expression of this precondition. Useful for debugging.
Parameters:
spaces - the identation for the printed output.

getClassName

public java.lang.String getClassName()
Returns the class name of a locally declared object, if applicable.
Returns:
the class name of a locally declared object.

getExpression

public JavaExpr getExpression()
Returns the expression that will produce the object to be inserted in the object base, or the RHS of the assignment, if applicable.
Returns:
the RHS expression of the attribution or the object to be inserted in the object base.

getIdent

public java.lang.String getIdent()
Returns the variable identifier, in case of a method call or the LHS of an assignment.
Returns:
the variable identifier for the LHS of an assignment or the variable used to invoke a method.

getMethodName

public java.lang.String getMethodName()
Returns the name of the method to be invoked, if applicable.
Returns:
the name of the method to be invoked, if applicable.

getType

public int getType()
Returns the type of this expression.
Returns:
the type of this expression.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object