/*************************************** * * * JBoss: The OpenSource J2EE WebOS * * * * Distributable under LGPL license. * * See terms of license at gnu.org. * * * ***************************************/ package org.jboss.util; /** * An abstract mutable number class. * *
This is a base wrapper class for java.lang.Number.
*
* @version $Revision: 1.1 $
* @author Jason Dillon
*/
public abstract class MuNumber
extends Number
implements Comparable, Cloneable, Mutable
{
/**
* Returns the value of the specified number as a byte.
* This may involve rounding or truncation.
*
* @return The numeric value represented by this object after conversion
* to type byte.
*/
public byte byteValue() {
return (byte)longValue();
}
/**
* Returns the value of the specified number as a short.
* This may involve rounding or truncation.
*
* @return The numeric value represented by this object after conversion
* to type short.
*/
public short shortValue() {
return (short)longValue();
}
/**
* Returns the value of the specified number as a int.
* This may involve rounding or truncation.
*
* @return The numeric value represented by this object after conversion
* to type int.
*/
public int intValue() {
return (int)longValue();
}
/**
* Returns the value of the specified number as a float.
* This may involve rounding or truncation.
*
* @return The numeric value represented by this object after conversion
* to type float.
*/
public float floatValue() {
return (float)doubleValue();
}
}