edu.ksu.cis.projects.bogor.ast
Class TypedId

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.TypedId
All Implemented Interfaces:
ITypeParent, Disposable, Serializable, Cloneable

public final class TypedId
extends Node
implements ITypeParent

Typed id AST.

Version:
CVS $Revision: 1.7 $ $Date: 2005/05/06 17:25:17 $
Author:
Robby , Matt Hoosier
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
TypedId(String id, ASTType type)
          Default constructor.
 
Method Summary
 TypedId clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to parent and id, and disposes type.
 String getId()
          Gets the id.
 ITypedIdParent getParent()
          Gets the parent of this object.
 ASTType getType()
          Gets the type.
 void setId(String newId)
          Sets the id.
 void setParent(ITypedIdParent newParent)
          Sets the parent of this object.
 void setType(ASTType newType)
          Sets the type.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node
getLocationInfo, getProperty, putProperty, setLocationInfo
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypedId

public TypedId(String id,
               ASTType type)
Default constructor. Sets this object as the type's parent.

Parameters:
id - The id. Must be non-null.
type - The type. Must be non-null.
Method Detail

setId

public void setId(String newId)
Sets the id.

Parameters:
newId - The new id. Must be non-null.

getId

public String getId()
Gets the id.

Returns:
The id. Non-null.

setParent

public void setParent(ITypedIdParent newParent)
Sets the parent of this object.

Parameters:
newParent - The new parent. Must be non-null.

getParent

public ITypedIdParent getParent()
Gets the parent of this object.

Returns:
The parent of this object.

setType

public void setType(ASTType newType)
Sets the type. Sets this object as the type's parent.

Parameters:
newType - The new type. Must be non-null.

getType

public ASTType getType()
Gets the type.

Returns:
The type. Non-null.

clone

public TypedId clone()
Clones this object (deep clone); including location info.

Specified by:
clone in class Node
Returns:
The clone of this object. Non-null.

dispose

public void dispose()
Removes reference to parent and id, and disposes type. Once called, avoid using this object.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class Node

toString

public String toString()
Returns the string representation of this object.

Specified by:
toString in class Node
Returns:
"type id".

visit

public void visit(ASTVisitor visitor)
Specified by:
visit in class Node