/* * @(#)XNumber.java 1.0 18 February 2001 * * Copyright 2004 * College of Computer and Information Science * Northeastern University * Boston, MA 02115 * * The Java Power Tools software may be used for educational * purposes as long as this copyright notice is retained intact * at the top of all source files. * * To discuss possible commercial use of this software, * contact Richard Rasala at Northeastern University, * College of Computer and Information Science, * 617-373-2462 or rasala@ccs.neu.edu. * * The Java Power Tools software has been designed and built * in collaboration with Viera Proulx and Jeff Raab. * * Should this software be modified, the words "Modified from * Original" must be included as a comment below this notice. * * All publication rights are retained. This software or its * documentation may not be published in any media either * in whole or in part without explicit permission. * * This software was created with support from Northeastern * University and from NSF grant DUE-9950829. */ package edu.neu.ccs; /** *
Abstract superclass for
* {@link Stringable Stringable} objects
* that wrap a numeric value, whether it is a primitive type
* or an arbitrary precision representation.
*
* The intention of this class is to provide a specification
* for the required casting operations for wrapper classes.
*
* It is documented, though not required
* that derived classes of this abstract class
* should police promotion and demotion between types
* and throw instances of NumberFormatException
* when such casting operations cannot be safely performed.
byte value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract byte byteValue();
/**
* Returns the value of this number
* as a short value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract short shortValue();
/**
* Returns the value of this number
* as a int value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract int intValue();
/**
* Returns the value of this number
* as a long value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract long longValue();
/**
* Returns the value of this number
* as a float value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract float floatValue();
/**
* Returns the value of this number
* as a double value.
*
* @throws NumberFormatException if the value cannot be
* promoted or demoted to the type
*/
public abstract double doubleValue();
}