All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.InstanceofExpression

java.lang.Object
   |
   +----openjava.ptree.PtreeObject
           |
           +----openjava.ptree.NonLeaf
                   |
                   +----openjava.ptree.InstanceofExpression

public class InstanceofExpression
extends NonLeaf
implements Expression
The InstanceofExpression represents the expression like :
     obj instanceof Object
 

If the operator in the expression of the left operand has week unity, this automatically produces the code in which the left operand is enclosed by parenthesises.
In the case the left is obj = obj2 and the right is String, this produces the code :
     (obj = obj2) instanceof String
 

See Also:
Expression, TypeSpecifier

Constructor Index

 o InstanceofExpression(Expression, TypeSpecifier)
Allocates a new object.

Method Index

 o getLeft()
Gets the expression of the left operand to be tested in this expression.
 o getTypeSpecifier()
Gets the type specifier of the right operand to be tested in this expression.
 o setLeft(Expression)
Sets the expression of the left operand to be tested in this expression.
 o setTypeSpecifier(TypeSpecifier)
Sets the type specifier of the right operand to be tested in this expression.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

 o InstanceofExpression
 public InstanceofExpression(Expression lexp,
                             TypeSpecifier tspec)
Allocates a new object.

Parameters:
lexp - the expression to test.
tspec - the typespecifier.

Methods

 o writeCode
 public void writeCode()
Writes the code this parse-tree presents for.

Overrides:
writeCode in class NonLeaf
 o getLeft
 public Expression getLeft()
Gets the expression of the left operand to be tested in this expression.

Returns:
the left expression.
 o setLeft
 public void setLeft(Expression lexpr)
Sets the expression of the left operand to be tested in this expression.

Parameters:
lexpr - the left expression to set.
 o getTypeSpecifier
 public TypeSpecifier getTypeSpecifier()
Gets the type specifier of the right operand to be tested in this expression.

Returns:
the type specifier.
 o setTypeSpecifier
 public void setTypeSpecifier(TypeSpecifier tspec)
Sets the type specifier of the right operand to be tested in this expression.

Parameters:
tspec - the type specifier to set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index