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

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

public final class StringConstant
extends Constant

String constant AST

Version:
CVS $Revision: 1.7 $ $Date: 2005/05/06 17:25:17 $
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
StringConstant(String id)
          Default constructor.
StringConstant(String id, ASTType coercedType)
          Default constructor.
StringConstant(String id, String string)
          Default constructor.
StringConstant(String id, String string, ASTType coercedType)
          Default constructor.
 
Method Summary
 StringConstant clone()
          Clones this object (deep clone); including location info.
 String getId()
          Gets the id.
 String getOptionalString()
          Gets the string.
 void setId(String newId)
          Sets the id.
 void setString(String newString)
          Sets the string.
 String toString()
          Returns the string representation of this object.
 void visit(ASTVisitor visitor)
           
 
Methods inherited from class edu.ksu.cis.projects.bogor.ast.Constant
dispose, getOptionalCoercedType, getParent, setCoercedType, 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

StringConstant

public StringConstant(String id)
Default constructor.

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

StringConstant

public StringConstant(String id,
                      String string)
Default constructor.

Parameters:
id - The id. Must be non-null.
string - The string. Must be non-null.

StringConstant

public StringConstant(String id,
                      ASTType coercedType)
Default constructor.

Parameters:
id - The id. Must be non-null.
coercedType - The type to which the value is cast. Must be non-null.

StringConstant

public StringConstant(String id,
                      String string,
                      ASTType coercedType)
Default constructor.

Parameters:
id - The id. Must be non-null.
string - The string. Must be non-null.
coercedType - The type to which the value is cast. 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.

setString

public void setString(String newString)
Sets the string.

Parameters:
newString - The new string. Must be non-null.

getOptionalString

public String getOptionalString()
Gets the string.

Returns:
The string constant, or null if the const is bound to the BIR null literal.

clone

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

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

toString

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

Specified by:
toString in class Node
Returns:
"id = string".

visit

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