home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-20 | 616 b | 26 lines |
-
- package simula.random;
-
- /**
- * Implementation of the class Value that encapsulate real values.
- * @see Value
- */
- public class RealValue extends Value {
-
- private double value;
-
-
- /**
- * Creates a new object encapsulating the given real value.
- * @param r The real value to encapsulate.
- */
- RealValue(double r) { value = r; }
- /**
- * Drawing a real value is the only meaningfull method.
- * @return The real number encapsulated in this object.
- * @exception TypeDrawnException Fired whenever meaningless
- */
- public double asReal() throws TypeDrawnException {
- return value;
- }
- }