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

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

public final class IntLiteral
extends Literal
implements NumericallyNegatableLiteral

Int literal AST

Version:
CVS $Revision: 1.8 $ $Date: 2005/05/05 20:46:16 $
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
IntLiteral(BigInteger integer)
          Default base 10 constructor.
IntLiteral(BigInteger integer, Radix radix)
          Default constructor.
IntLiteral(int integer)
          Equivalent to IntLiteral(BigInteger.valueOf(integer))
IntLiteral(int integer, Radix radix)
          Equivalent to IntLiteral(BigInteger.valueOf(integer), radix)
 
Method Summary
 IntLiteral clone()
          Clones this object (deep clone); including location info.
 BigInteger getInteger()
          Gets the integer.
 Radix getRadix()
           
 void negate()
          Convert the numeric value of this node to -v, where v is the value in the pre-state.
 void setInteger(BigInteger newInteger)
          Sets the integer.
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.Literal
dispose, 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

IntLiteral

public IntLiteral(BigInteger integer,
                  Radix radix)
Default constructor.

Parameters:
integer - The integer.
radix - Base used to encode the literal.

IntLiteral

public IntLiteral(BigInteger integer)
Default base 10 constructor. Equivalent to IntLiteral(integer, Radix.DECIMAL).

Parameters:
integer - The integer.

IntLiteral

public IntLiteral(int integer)
Equivalent to IntLiteral(BigInteger.valueOf(integer))

Parameters:
integer - The integer.

IntLiteral

public IntLiteral(int integer,
                  Radix radix)
Equivalent to IntLiteral(BigInteger.valueOf(integer), radix)

Parameters:
integer - The integer.
radix - Base used to encode the literal.
Method Detail

setInteger

public void setInteger(BigInteger newInteger)
Sets the integer.

Parameters:
newInteger - The new integer.

getInteger

public BigInteger getInteger()
Gets the integer.

Returns:
The integer.

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

clone

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

Specified by:
clone in class Literal
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:
"integer".

visit

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

setRadix

protected void setRadix(Radix newRadix)

getRadix

public Radix getRadix()