koala.dynamicjava.tree
Class FormalParameter

java.lang.Object
  extended by koala.dynamicjava.tree.Node
      extended by koala.dynamicjava.tree.Declaration
          extended by koala.dynamicjava.tree.FormalParameter
All Implemented Interfaces:
SourceInfo.Wrapper

public class FormalParameter
extends Declaration

This class represents the method parameters in the syntax tree

Version:
1.0 - 1999/05/11
Author:
Stephane Hillion

Constructor Summary
FormalParameter(ModifierSet mods, TypeName t, java.lang.String n)
          Initializes the node
FormalParameter(ModifierSet mods, TypeName t, java.lang.String n, SourceInfo si)
          Initializes the node
 
Method Summary
<T> T
acceptVisitor(Visitor<T> visitor)
          Allows a visitor to traverse the tree
 java.lang.String getName()
          The name of this parameter
 TypeName getType()
          Returns the declaring type of this parameter
 void setName(java.lang.String s)
          Sets this parameter's name
 void setType(TypeName t)
          Sets the type of this parameter
 java.lang.String toString()
          Implementation of toString for use in unit testing
 
Methods inherited from class koala.dynamicjava.tree.Declaration
getModifiers, setModifiers
 
Methods inherited from class koala.dynamicjava.tree.Node
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormalParameter

public FormalParameter(ModifierSet mods,
                       TypeName t,
                       java.lang.String n)
Initializes the node

Parameters:
mods - the modifiers
t - the type of the parameter
n - the name of the parameter
Throws:
java.lang.IllegalArgumentException - if t is null or n is null

FormalParameter

public FormalParameter(ModifierSet mods,
                       TypeName t,
                       java.lang.String n,
                       SourceInfo si)
Initializes the node

Parameters:
mods - the modifiers
t - the type of the parameter
n - the name of the parameter
Throws:
java.lang.IllegalArgumentException - if t is null or n is null
Method Detail

getType

public TypeName getType()
Returns the declaring type of this parameter


setType

public void setType(TypeName t)
Sets the type of this parameter

Throws:
java.lang.IllegalArgumentException - if t is null

getName

public java.lang.String getName()
The name of this parameter


setName

public void setName(java.lang.String s)
Sets this parameter's name

Throws:
java.lang.IllegalArgumentException - if s is null

acceptVisitor

public <T> T acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree

Specified by:
acceptVisitor in class Node
Parameters:
visitor - the visitor to accept

toString

public java.lang.String toString()
Implementation of toString for use in unit testing

Overrides:
toString in class java.lang.Object