Back to index

plt-scheme  4.2.1
Number.java
Go to the documentation of this file.
00001 /* Number.java =- abstract superclass of numeric objects
00002    Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
00003 
00004 This file is part of GNU Classpath.
00005 
00006 GNU Classpath is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2, or (at your option)
00009 any later version.
00010 
00011 GNU Classpath is distributed in the hope that it will be useful, but
00012 WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with GNU Classpath; see the file COPYING.  If not, write to the
00018 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019 02111-1307 USA.
00020 
00021 Linking this library statically or dynamically with other modules is
00022 making a combined work based on this library.  Thus, the terms and
00023 conditions of the GNU General Public License cover the whole
00024 combination.
00025 
00026 As a special exception, the copyright holders of this library give you
00027 permission to link this library with independent modules to produce an
00028 executable, regardless of the license terms of these independent
00029 modules, and to copy and distribute the resulting executable under
00030 terms of your choice, provided that you also meet, for each linked
00031 independent module, the terms and conditions of the license of that
00032 module.  An independent module is a module which is not derived from
00033 or based on this library.  If you modify this library, you may extend
00034 this exception to your version of the library, but you are not
00035 obligated to do so.  If you do not wish to do so, delete this
00036 exception statement from your version. */
00037 
00038 
00039 package java.lang;
00040 
00041 import java.io.Serializable;
00042 
00058 public abstract class Number implements Serializable
00059 {
00063   private static final long serialVersionUID = -8742448824652078965L;
00064 
00068   static final char[] digits = {
00069     '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
00070     'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
00071     'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
00072     'u', 'v', 'w', 'x', 'y', 'z',
00073   };
00074 
00078   public Number()
00079   {
00080   }
00081 
00087   public abstract int intValue();
00088 
00094   public abstract long longValue();
00095 
00101   public abstract float floatValue();
00102 
00108   public abstract double doubleValue();
00109 
00116   public byte byteValue()
00117   {
00118     return (byte) intValue();
00119   }
00120 
00127   public short shortValue()
00128   {
00129     return (short) intValue();
00130   }
00131 }