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

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

public final class Location
extends Node

Location AST.

Version:
CVS $Revision: 1.11 $ $Date: 2005/06/08 17:59:55 $
Author:
Robby
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node
ILLEGAL_LOCAL_ID_CHAR
 
Constructor Summary
Location(String id, List<? extends Transformation> transformations)
          Default constructor.
Location(String id, LiveSet liveSet, List<? extends Transformation> transformations)
          Default constructor with live set.
 
Method Summary
 Location clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes references to parent and id, and disposes catches, liveSet, and transformations.
 String getId()
          Gets the id.
 LiveSet getOptionalLiveSet()
          Gets the liveset.
 FSM getParent()
          Gets the parent of this object.
 Transformation getTransformation(int index)
          Gets a transformation at a specified index.
 int getTransformationCount()
          Gets the number of transformations.
 void removeLiveSet()
          Un-install the current liveset (if any).
 void setId(String newId)
          Sets the id.
 void setLiveSet(LiveSet newLiveSet)
          Sets the liveset.
 void setParent(FSM newParent)
          Sets the parent of this object.
 void setTransformations(List<? extends Transformation> newTransformations)
          Sets the transformations.
 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

Location

public Location(String id,
                List<? extends Transformation> transformations)
Default constructor. Sets this object as tranformation's parent.

Parameters:
id - The id. Must be non-null.
transformations - The transformations. Must be non-null. Each element must be instance of Transformation. The number of elements must be greater than zero.

Location

public Location(String id,
                LiveSet liveSet,
                List<? extends Transformation> transformations)
Default constructor with live set. Sets this object as the liveSet's and each tranformation's parent.

Parameters:
id - The id. Must be non-null.
liveSet - The liveset. Must be non-null.
transformations - The transformations. Must be non-null. Each element must be instance of Transformation. The number of elements must be greater than zero.
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.

setLiveSet

public void setLiveSet(LiveSet newLiveSet)
Sets the liveset. Sets this object as the liveset's parent.

Parameters:
newLiveSet - The new liveset. Must be non-null.

removeLiveSet

public void removeLiveSet()
Un-install the current liveset (if any).


getOptionalLiveSet

public LiveSet getOptionalLiveSet()
Gets the liveset.

Returns:
The liveset. Non-null.

setParent

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

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

getParent

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

Returns:
The parent of this object.

getTransformation

public Transformation getTransformation(int index)
Gets a transformation at a specified index.

Parameters:
index - The index of the transformation. Must be between 0 and getTransformationCount() - 1, inclusive.
Returns:
The transformation at the specified index.

getTransformationCount

public int getTransformationCount()
Gets the number of transformations.

Returns:
The number of transformations. Greater than zero.

setTransformations

public void setTransformations(List<? extends Transformation> newTransformations)
Sets the transformations. Sets this object as each transformation's parent.

Parameters:
newTransformations - The new transformations. Must be non-null. Each element must be instance of Transformation. The number of elements must be greater than zero.

clone

public Location 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 references to parent and id, and disposes catches, liveSet, and transformations. 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:
 
  
   
    
       "        loc id: [ live { ( , id )* } ]\n"
       + "( transformations )+".
     
    
   
  
 

visit

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