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

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.LongConstant
All Implemented Interfaces:
NumericallyNegatableLiteral, Disposable, Serializable, Cloneable

public final class LongConstant
extends Constant
implements NumericallyNegatableLiteral

Long constant AST

Version:
CVS $Revision: 1.12 $ $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
LongConstant(String id, BigInteger l)
          Default base 10 constructor.
LongConstant(String id, BigInteger l, ASTType coercedType)
          Default base 10 constructor.
LongConstant(String id, BigInteger l, Radix radix)
          Default constructor.
LongConstant(String id, BigInteger l, Radix radix, ASTType coercedType)
          Default constructor.
LongConstant(String id, long l)
          Default base 10 constructor.
LongConstant(String id, long l, ASTType coercedType)
          Default base 10 constructor.
LongConstant(String id, long l, Radix radix)
          Default constructor.
LongConstant(String id, long l, Radix radix, ASTType coercedType)
          Default constructor.
 
Method Summary
 LongConstant clone()
          Clones this object (deep clone); including location info.
 String getId()
          Gets the id.
 BigInteger getLong()
          Gets the long.
 Radix getRadix()
           
 void negate()
          Convert the numeric value of this node to -v, where v is the value in the pre-state.
 void setId(String newId)
          Sets the id.
 void setLong(BigInteger newLong)
          Sets the long.
protected  void setRadix(Radix newRadix)
           
 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

LongConstant

public LongConstant(String id,
                    BigInteger l,
                    Radix radix)
Default constructor.

Parameters:
id - The id. Must be non-null.
radix - Base used to encode the value.
l - The long.

LongConstant

public LongConstant(String id,
                    long l,
                    Radix radix)
Default constructor.

Parameters:
id - The id. Must be non-null.
radix - Base used to encode the value.
l - The long.

LongConstant

public LongConstant(String id,
                    BigInteger l)
Default base 10 constructor. Equivalent to LongConstant(id, l, Radix.DECIMAL)

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

LongConstant

public LongConstant(String id,
                    long l)
Default base 10 constructor. Equivalent to LongConstant(id, l, Radix.DECIMAL)

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

LongConstant

public LongConstant(String id,
                    BigInteger l,
                    Radix radix,
                    ASTType coercedType)
Default constructor.

Parameters:
id - The id. Must be non-null.
l - The long.
radix - Base used to encode the value.
coercedType - The type to which the value is cast. Must be non-null.

LongConstant

public LongConstant(String id,
                    long l,
                    Radix radix,
                    ASTType coercedType)
Default constructor.

Parameters:
id - The id. Must be non-null.
l - The long.
radix - Base used to encode the value.
coercedType - The type to which the value is cast. Must be non-null.

LongConstant

public LongConstant(String id,
                    BigInteger l,
                    ASTType coercedType)
Default base 10 constructor. Equivalent to LongConstant(id, l, Radix.DECIMAL, coercedType)

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

LongConstant

public LongConstant(String id,
                    long l,
                    ASTType coercedType)
Default base 10 constructor. Equivalent to LongConstant(id, l, Radix.DECIMAL, coercedType)

Parameters:
id - The id. Must be non-null.
l - The long.
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.

setLong

public void setLong(BigInteger newLong)
Sets the long.

Parameters:
newLong - The new long.

getLong

public BigInteger getLong()
Gets the long.

Returns:
The long.

negate

public void negate()
Convert the numeric value of this node to -v, where v is the value in the pre-state.

Specified by:
negate in interface NumericallyNegatableLiteral

setRadix

protected void setRadix(Radix newRadix)

getRadix

public Radix getRadix()

clone

public LongConstant 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 = long".

visit

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