literals
Class PSNumber

java.lang.Object
  extended byliterals.PSNumber
All Implemented Interfaces:
PSLiteral, PSObject

public class PSNumber
extends java.lang.Object
implements PSLiteral


Constructor Summary
PSNumber()
          Creates a new PSNumber object with a default value set to zero.
PSNumber(double number)
          Creates a new PSNumber object with its value set to the value(double) being given as a parameter.
PSNumber(int number)
          Creates a new PSNumber object with its value set to the value(int) being given as a parameter.
 
Method Summary
 double getValue()
          Returns the number being encapsulated.
 java.lang.String toString()
          Converts the encapsulated value into string

Precondition : The instance is in a valid form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PSNumber

public PSNumber()
Creates a new PSNumber object with a default value set to zero.

Precondition : -
Postcondition : A new PSNumber will be created with a value set to zero.


PSNumber

public PSNumber(int number)
Creates a new PSNumber object with its value set to the value(int) being given as a parameter.

Precondition : -
Postcondition : A new PSNumber will be created with a value(int) that has been given as a parameter.

Parameters:
number - The initialization value(int) of the newly created PSNumber.

PSNumber

public PSNumber(double number)
Creates a new PSNumber object with its value set to the value(double) being given as a parameter.

Precondition : -
Postcondition : A new PSNumber will be created with a value(double) that has been given as a parameter.

Parameters:
number - The initialization value(double) of the newly created PSNumber.
Method Detail

getValue

public double getValue()
Returns the number being encapsulated.

Precondition : The instance is in a valid form.
Postcondition : The value of PSNumber will be returned.

Returns:
The value that PSNumber holds.

toString

public java.lang.String toString()
Converts the encapsulated value into string

Precondition : The instance is in a valid form.
Postcondition : The value of PSNumber in a string form will be returned.

Specified by:
toString in interface PSLiteral
Returns:
The encapsulated value of PSNumber in astring form.