home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / java.z / Number.java < prev    next >
Text File  |  1996-05-03  |  2KB  |  60 lines

  1. /*
  2.  * @(#)Number.java    1.15 95/07/27  
  3.  *
  4.  * Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package java.lang;
  21.  
  22. /**
  23.  * Number is an abstract superclass for numeric scalar types.
  24.  * Integer, Long, Float and Double are subclasses of Number that bind
  25.  * to a particular numeric representation.<p>
  26.  *
  27.  * @see    Integer
  28.  * @see    Long
  29.  * @see    Float
  30.  * @see    Double
  31.  * @version     1.15, 27 Jul 1995
  32.  * @author    Lee Boynton
  33.  * @author    Arthur van Hoff
  34.  */
  35. public abstract class Number {
  36.     /**
  37.      * Returns the value of the number as an int.
  38.      * This may involve rounding if the number is not already an integer.
  39.      */
  40.     public abstract int intValue();
  41.  
  42.     /**
  43.      * Returns the value of the number as a long.  This may involve rounding
  44.      * if the number is not already a long.
  45.      */
  46.     public abstract long longValue();
  47.  
  48.     /**
  49.      * Returns the value of the number as a float.  This may involve rounding
  50.      * if the number is not already a float.
  51.      */
  52.     public abstract float floatValue();
  53.  
  54.     /**
  55.      * Returns the value of the number as a double.  This may involve rounding
  56.      * if the number is not already a double.
  57.      */
  58.     public abstract double doubleValue();
  59. }
  60.