home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / simula / random / RealValue.java < prev    next >
Encoding:
Java Source  |  1998-02-20  |  616 b   |  26 lines

  1.  
  2. package simula.random;
  3.  
  4. /**
  5.  * Implementation of the class Value that encapsulate real values.
  6.  * @see Value
  7.  */
  8. public class RealValue extends Value {
  9.  
  10.     private double value;
  11.  
  12.  
  13.     /**
  14.      * Creates a new object encapsulating the given real value.
  15.      * @param r The real value to encapsulate.
  16.      */
  17.     RealValue(double r) { value = r;    }
  18.     /**
  19.      * Drawing a real value is the only meaningfull method.
  20.      * @return The real number encapsulated in this object. 
  21.      * @exception TypeDrawnException Fired whenever meaningless
  22.      */  
  23.     public double asReal() throws TypeDrawnException {
  24.         return value;
  25.     } 
  26. }