koala.dynamicjava.tree
Class VariableDeclaration

java.lang.Object
  extended bykoala.dynamicjava.tree.Node
      extended bykoala.dynamicjava.tree.VariableDeclaration

public class VariableDeclaration
extends Node

This class represents variable declarations in an AST


Field Summary
static java.lang.String FINAL
          The final property name
static java.lang.String INITIALIZER
          The initializer property name
static java.lang.String NAME
          The name property name
static java.lang.String TYPE
          The type property name
 
Fields inherited from class koala.dynamicjava.tree.Node
BEGIN_COLUMN, BEGIN_LINE, END_COLUMN, END_LINE, FILENAME
 
Constructor Summary
VariableDeclaration(boolean fin, Type type, java.lang.String name, Expression init)
          Creates a new variable declaration
VariableDeclaration(boolean fin, Type type, java.lang.String name, Expression init, java.lang.String fn, int bl, int bc, int el, int ec)
          Creates a new variable declaration
 
Method Summary
 java.lang.Object acceptVisitor(Visitor visitor)
          Allows a visitor to traverse the tree
 Expression getInitializer()
          Returns the initializer for this variable
 java.lang.String getName()
          Returns the name of this variable
 Type getType()
          Gets the declared type for this variable
 boolean isFinal()
          Returns true if this variable is final
 void setFinal(boolean b)
          Sets the final flag
 void setInitializer(Expression e)
          Sets the initializer
 void setName(java.lang.String s)
          Sets the variable's name
 void setType(Type t)
          Sets the type of this field
 
Methods inherited from class koala.dynamicjava.tree.Node
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getFilename, getProperties, getProperty, hasProperty, removePropertyChangeListener, removePropertyChangeListener, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setFilename, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FINAL

public static final java.lang.String FINAL
The final property name

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
The type property name

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
The name property name

See Also:
Constant Field Values

INITIALIZER

public static final java.lang.String INITIALIZER
The initializer property name

See Also:
Constant Field Values
Constructor Detail

VariableDeclaration

public VariableDeclaration(boolean fin,
                           Type type,
                           java.lang.String name,
                           Expression init)
Creates a new variable declaration

Parameters:
fin - is this variable final?
type - the type of this variable
name - the name of this variable
init - the initializer
Throws:
java.lang.IllegalArgumentException - if name is null or type is null

VariableDeclaration

public VariableDeclaration(boolean fin,
                           Type type,
                           java.lang.String name,
                           Expression init,
                           java.lang.String fn,
                           int bl,
                           int bc,
                           int el,
                           int ec)
Creates a new variable declaration

Parameters:
fin - is this variable final?
type - the type of this variable
name - the name of this variable
init - the initializer
fn - the filename
bl - the begin line
bc - the begin column
el - the end line
ec - the end column
Throws:
java.lang.IllegalArgumentException - if name is null or type is null
Method Detail

isFinal

public boolean isFinal()
Returns true if this variable is final


setFinal

public void setFinal(boolean b)
Sets the final flag


getType

public Type getType()
Gets the declared type for this variable


setType

public void setType(Type t)
Sets the type of this field

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

getName

public java.lang.String getName()
Returns the name of this variable


setName

public void setName(java.lang.String s)
Sets the variable's name

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

getInitializer

public Expression getInitializer()
Returns the initializer for this variable


setInitializer

public void setInitializer(Expression e)
Sets the initializer


acceptVisitor

public java.lang.Object acceptVisitor(Visitor visitor)
Allows a visitor to traverse the tree

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


Copyright © 2001 Stephane Hillion. All Rights Reserved.