All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.Value

java.lang.Object
   |
   +----simula.random.Value

public class Value
extends Object
The class Value is the value extracted from the pseudo-random generator. It encapsulate either boolean, integer or real values. The three implementation of this class supply infact these values. Trying to get the wrong type of value fires an exception. The class Value fires exception in every case.

See Also:
draw, BooleanValue, IntegerValue, RealValue

Constructor Index

 o Value()

Method Index

 o asBoolean()
Returns a boolean representation of the value.
 o asInteger()
Returns an integer representation of the value.
 o asReal()
Returns a real representation of the value.

Constructors

 o Value
 public Value()

Methods

 o asBoolean
 public boolean asBoolean() throws TypeDrawnException
Returns a boolean representation of the value. If it is meaningless fires an Exception.

Returns:
a boolean representation of the value. If it is meaningless fires an Exception.
Throws: TypeDrawnException
fired if meaningless.
 o asInteger
 public int asInteger() throws TypeDrawnException
Returns an integer representation of the value. If it is meaningless fires an Exception.

Returns:
an integer representation of the value. If it is meaningless fires an Exception.
Throws: TypeDrawnException
fired if meaningless.
 o asReal
 public double asReal() throws TypeDrawnException
Returns a real representation of the value. If it is meaningless fires an Exception.

Returns:
a real representation of the value. If it is meaningless fires an Exception.
Throws: TypeDrawnException
fired if meaningless.

All Packages  Class Hierarchy  This Package  Previous  Next  Index