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

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

public final class Global
extends SystemMember
implements IInitialValueParent, ITypedIdParent

The top level class for global AST.

Version:
CVS $Revision: 1.8 $ $Date: 2005/02/05 02:41:24 $
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
Global(TypedId typedId, boolean isTransient)
          Default constructor.
Global(TypedId typedId, InitialValue value, boolean isTransient)
          Constructor with literal or id.
 
Method Summary
 Global clone()
          Clones this object (deep clone); including location info.
 void dispose()
          Disposes typedId and value.
 InitialValue getOptionalValue()
          Gets the value.
 boolean getTransient()
           
 TypedId getTypedId()
          Gets the typed-id.
 void setTransient(boolean isTransient)
           
 void setTypedId(TypedId newTypedId)
          Sets the typed-id.
 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.SystemMember
getParent, setParent
 
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

Global

public Global(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.

Global

public Global(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.

setTransient

public void setTransient(boolean isTransient)

getTransient

public boolean getTransient()

setTypedId

public void setTypedId(TypedId newTypedId)
Sets the typed-id. Sets this object as the typed-id's parent.

Parameters:
newTypedId - The new typed-id. Must be non-null.

getTypedId

public TypedId getTypedId()
Gets the typed-id.

Returns:
The typed-id. Non-null.

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 Global clone()
Clones this object (deep clone); including location info.

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

dispose

public void dispose()
Disposes typedId and value. Once called, avoid using this object.

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

toString

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

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

visit

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