All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.Parameter

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

public class Parameter
extends NonLeaf
The Parameter class represents parameter node of parse tree. Modifiers of parameter are supported from JDK 1.1. The code like:
     void test( final int i ){
         ....
     }
 

is allowed from JDK 1.1.

See Also:
Ptree, NonLeaf, ModifierList, TypeSpecifier, Identifier

Constructor Index

 o Parameter(ModifierList, TypeSpecifier, Identifier)
Allocates a new object.
 o Parameter(TypeSpecifier, Identifier)
Allocates a new object.

Method Index

 o getModifiers()
Gets the modifiers of this parameter.
 o getTypeSpecifier()
Gets the type specifier of this parameter.
 o getVariable()
Gets the variable name of this parameter.
 o setModifiers(ModifierList)
Sets the modifiers of this parameter.
 o setTypeSpecifier(TypeSpecifier)
Sets the type specifier of this parameter.
 o setVariable(Identifier)
Sets the variable name of this parameter.
 o writeCode()
Writes the code this parse-tree presents for.

Constructors

 o Parameter
 public Parameter(ModifierList modiflist,
                  TypeSpecifier typespec,
                  Identifier declname)
Allocates a new object.

Parameters:
modfiers - modifier list of the new parameter
typespec - type specifier includes array dimension info
declname - the parameter's name, including no array dim.
 o Parameter
 public Parameter(TypeSpecifier typespec,
                  Identifier declname)
Allocates a new object.

Parameters:
typespec - type specifier includes array dimension info
declname - the parameter's name, also includes array dim arg modfier is null means parameter has no modifier

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 modifiers of this parameter.

Returns:
the modfiers.
 o setModifiers
 public void setModifiers(ModifierList modifs)
Sets the modifiers of this parameter.

Parameters:
modifs - the modfiers to set.
 o getTypeSpecifier
 public TypeSpecifier getTypeSpecifier()
Gets the type specifier of this parameter.

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

Parameters:
tspec - the type specifier to set.
 o getVariable
 public Identifier getVariable()
Gets the variable name of this parameter.

Returns:
the variable name.
 o setVariable
 public void setVariable(Identifier varname)
Sets the variable name of this parameter.

Parameters:
varname - the variable name to set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index