All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.VariableDeclaration

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

public class VariableDeclaration
extends NonLeaf
implements Statement
The VariableDeclaration class presents local variable declaration statement node of parse tree.

See Also:
Ptree, NonLeaf, Statement, ModifierList, TypeSpecifier, VariableDeclarator, TypeSpecifier, VariableInitializer

Constructor Index

 o VariableDeclaration(ModifierList, TypeSpecifier, Identifier, VariableInitializer)
Allocates a new object.
 o VariableDeclaration(ModifierList, TypeSpecifier, VariableDeclarator)
Allocates a new object.
 o VariableDeclaration(TypeSpecifier, Identifier, VariableInitializer)
Allocates a new object.
 o VariableDeclaration(TypeSpecifier, VariableDeclarator)
Allocates a new object.

Method Index

 o getInitializer()
Gets variable initializer.
 o getModifiers()
Gets the modifer list of this variable declaration.
 o getTypeSpecifier()
Gets the type specifier of this variable declaration.
 o getVariable()
Gets declarator name, declarator name includes variable name but its dimension.
 o getVariableDeclarator()
Gets the variable declarator of this variable declaration.
 o setInitializer(VariableInitializer)
Sets variable initializer.
 o setModifiers(ModifierList)
Sets the modifer list of this variable declaration.
 o setTypeSpecifier(TypeSpecifier)
Sets the type specifier of this variable declaration.
 o setVariable(Identifier)
Sets declarator name, declarator name includes variable name but its dimension.
 o setVariableDeclarator(VariableDeclarator)
Sets the variable declarator of this variable declaration.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

 o VariableDeclaration
 public VariableDeclaration(ModifierList modifs,
                            TypeSpecifier typespec,
                            VariableDeclarator vdeclr)
Allocates a new object.

Parameters:
modifs - the modifier list of this variable declaration.
typespec - the type specifier.
vdeclr - the variable declarator.
 o VariableDeclaration
 public VariableDeclaration(TypeSpecifier typespec,
                            VariableDeclarator vdeclr)
Allocates a new object.

Parameters:
typespec - the type specifier.
vdeclr - the variable declarator.
 o VariableDeclaration
 public VariableDeclaration(ModifierList modifs,
                            TypeSpecifier typespec,
                            Identifier vname,
                            VariableInitializer vinit)
Allocates a new object.

Parameters:
modifs - the modifier list of this variable declaration.
typespec - the type specifier.
vname - the variable name.
vinit - the variable initializer.
 o VariableDeclaration
 public VariableDeclaration(TypeSpecifier typespec,
                            Identifier vname,
                            VariableInitializer vinit)
Allocates a new object.

Parameters:
modifs - the modifier list of this variable declaration.
typespec - the type specifier.
vname - the variable name.
vinit - the variable initializer.

Methods

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

Overrides:
writeCode in class NonLeaf
 o getModifiers
 public ModifierList getModifiers()
Gets the modifer list of this variable declaration.

Returns:
the modifier list.
 o setModifiers
 public void setModifiers(ModifierList modifs)
Sets the modifer list of this variable declaration.

Parameters:
modifs - the modifier list to set.
 o getTypeSpecifier
 public TypeSpecifier getTypeSpecifier()
Gets the type specifier of this variable declaration.

Returns:
the type specifier.
 o setTypeSpecifier
 public void setTypeSpecifier(TypeSpecifier tspec)
Sets the type specifier of this variable declaration.

Parameters:
tspec - the type specifier to set.
 o getVariableDeclarator
 public VariableDeclarator getVariableDeclarator()
Gets the variable declarator of this variable declaration.

Returns:
the variable declarator.
 o setVariableDeclarator
 public void setVariableDeclarator(VariableDeclarator vdeclr)
Sets the variable declarator of this variable declaration.

Parameters:
vdeclr - the variable declarator to set.
 o getVariable
 public Identifier getVariable()
Gets declarator name, declarator name includes variable name but its dimension.

Returns:
declarator name
 o setVariable
 public void setVariable(Identifier name)
Sets declarator name, declarator name includes variable name but its dimension.

Parameters:
name - declarator name to set.
See Also:
TypeSpecifier
 o getInitializer
 public VariableInitializer getInitializer()
Gets variable initializer.

Returns:
variable initializer.
 o setInitializer
 public void setInitializer(VariableInitializer vinit)
Sets variable initializer.

Parameters:
vinit - the variable initializer to set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index