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
-
Value()
-
-
asBoolean()
- Returns a boolean representation of the value.
-
asInteger()
- Returns an integer representation of the value.
-
asReal()
- Returns a real representation of the value.
Value
public Value()
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.
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.
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