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
-
InstanceofExpression(Expression, TypeSpecifier)
- Allocates a new object.
-
getLeft()
- Gets the expression of the left operand to be tested
in this expression.
-
getTypeSpecifier()
- Gets the type specifier of the right operand to be tested
in this expression.
-
setLeft(Expression)
- Sets the expression of the left operand to be tested
in this expression.
-
setTypeSpecifier(TypeSpecifier)
- Sets the type specifier of the right operand to be tested
in this expression.
-
writeCode()
- Writes the code this parse-tree presents for.
InstanceofExpression
public InstanceofExpression(Expression lexp,
TypeSpecifier tspec)
- Allocates a new object.
- Parameters:
- lexp - the expression to test.
- tspec - the typespecifier.
writeCode
public void writeCode()
- Writes the code this parse-tree presents for.
- Overrides:
- writeCode in class NonLeaf
getLeft
public Expression getLeft()
- Gets the expression of the left operand to be tested
in this expression.
- Returns:
- the left expression.
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.
getTypeSpecifier
public TypeSpecifier getTypeSpecifier()
- Gets the type specifier of the right operand to be tested
in this expression.
- Returns:
- the type specifier.
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