All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class openjava.ptree.Literal

java.lang.Object
   |
   +----openjava.ptree.PtreeObject
           |
           +----openjava.ptree.Leaf
                   |
                   +----openjava.ptree.Literal

public class Literal
extends Leaf
implements Expression
The Literal class represents a literal.

See Also:
Leaf, Expression

Variable Index

 o CHARACTER
 o FALSE
 o NUMBER
 o STRING
 o TRUE

Constructor Index

 o Literal(int)
Allocates a new object.
 o Literal(int, String)
Allocates a new object.

Method Index

 o getID()
Use getKind() Deprecated.
 o getKind()
Returns the id number indicating the kind of this literal.
 o makeLiteral(boolean)
Makes a new object of Literal class from the boolean.
 o makeLiteral(char)
Makes a new object of Literal class from the character.
 o makeLiteral(double)
Makes a new object of Literal class from the number.
 o makeLiteral(float)
Makes a new object of Literal class from the number.
 o makeLiteral(int)
Makes a new object of Literal class from the number.
 o makeLiteral(long)
Makes a new object of Literal class from the number.
 o makeLiteral(String)
Makes a new object of Literal class from the string.

Variables

 o TRUE
 public static final int TRUE
 o FALSE
 public static final int FALSE
 o STRING
 public static final int STRING
 o NUMBER
 public static final int NUMBER
 o CHARACTER
 public static final int CHARACTER

Constructors

 o Literal
 public Literal(int id)
Allocates a new object.

Parameters:
id - the id number of the literal.
 o Literal
 public Literal(int id,
                String str)
Allocates a new object. If you want to make String literal like "test", call this constructor in the form :
     new Literal( Literal.STRING, "\"test\"" )
 

or use makeLiteral() static method.

Parameters:
id - the id number of the literal.
str - the literal as a String.
See Also:
makeLiteral

Methods

 o getKind
 public int getKind()
Returns the id number indicating the kind of this literal.

Returns:
the id number
 o getID
 public int getID()
Note: getID() is deprecated.

Use getKind()

 o makeLiteral
 public static Literal makeLiteral(String str)
Makes a new object of Literal class from the string.

Parameters:
str - the string.
 o makeLiteral
 public static Literal makeLiteral(boolean b)
Makes a new object of Literal class from the boolean.

Parameters:
b - the boolean.
 o makeLiteral
 public static Literal makeLiteral(char c)
Makes a new object of Literal class from the character.

Parameters:
c - the character.
 o makeLiteral
 public static Literal makeLiteral(int num)
Makes a new object of Literal class from the number.

Parameters:
num - the number.
 o makeLiteral
 public static Literal makeLiteral(long num)
Makes a new object of Literal class from the number.

Parameters:
num - the number.
 o makeLiteral
 public static Literal makeLiteral(float num)
Makes a new object of Literal class from the number.

Parameters:
num - the number.
 o makeLiteral
 public static Literal makeLiteral(double num)
Makes a new object of Literal class from the number.

Parameters:
num - the number.

All Packages  Class Hierarchy  This Package  Previous  Next  Index