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

java.lang.Object
  extended by edu.ksu.cis.projects.bogor.ast.Node
      extended by edu.ksu.cis.projects.bogor.ast.AbstractLocal
          extended by edu.ksu.cis.projects.bogor.ast.Local
All Implemented Interfaces:
IExpParent, IInitialValueParent, ITypedIdParent, Disposable, Serializable, Cloneable

public final class Local
extends AbstractLocal
implements IInitialValueParent

Version:
CVS $Revision: 1.7 $ $Date: 2005/02/05 02:41:24 $
Author:
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
Local(TypedId typedId, boolean isTransient)
          Default constructor.
Local(TypedId typedId, InitialValue value, boolean isTransient)
          Constructor with literal or id.
 
Method Summary
 Local clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Removes reference to parent and disposes typedId and value.
 InitialValue getOptionalValue()
          Gets the value.
 void setValue(InitialValue newValue)
          Sets the value.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.AbstractLocal
getParent, getTransient, getTypedId, setParent, setTransient, setTypedId
 
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

Local

public Local(TypedId typedId,
             boolean isTransient)
Default constructor. Sets this object as the typed-id's parent.

Parameters:
typedId - The typed-id. Must be non-null.
isTransient - Flag indicating whether this variable should be encoded in state vector.

Local

public Local(TypedId typedId,
             InitialValue value,
             boolean isTransient)
Constructor with literal or id. Sets this object as the typed-id's and value's parent.

Parameters:
typedId - The typed-id. Must be non-null.
value - The value. Must be non-null.
isTransient - Flag indicating whether this variable should be encoded in state vector.
Method Detail

getOptionalValue

public InitialValue getOptionalValue()
Gets the value.

Returns:
The value.

setValue

public void setValue(InitialValue newValue)
Sets the value. Sets this object as the value's parent.

Parameters:
newValue - The new value. Must be non-null.

clone

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

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

dispose

public void dispose()
Description copied from class: AbstractLocal
Removes reference to parent and disposes typedId and value. Once called, avoid using this object.

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

toString

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

Specified by:
toString in class Node
Returns:
"[transient] typedId [ := value ];".

visit

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