/*
 * JBoss, Home of Professional Open Source
 * Copyright 2005, JBoss Inc., and individual contributors as indicated
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.jboss.util;

/**
 * An abstract mutable number class.
 *
 * <p>This is a base wrapper class for <code>java.lang.Number</code>.
 *
 * @version <tt>$Revision: 1.1.4.1 $</tt>
 * @author  <a href="mailto:jason@planet57.com">Jason Dillon</a>
 */
public abstract class MuNumber 
   extends Number
   implements Comparable, Cloneable, Mutable
{
   /**
    * Returns the value of the specified number as a <code>byte</code>.
    * This may involve rounding or truncation.
    *
    * @return  The numeric value represented by this object after conversion
    *          to type <code>byte</code>.
    */
   public byte byteValue() {
      return (byte)longValue();
   } 

   /**
    * Returns the value of the specified number as a <code>short</code>.
    * This may involve rounding or truncation.
    *
    * @return  The numeric value represented by this object after conversion
    *          to type <code>short</code>.
    */
   public short shortValue() {
      return (short)longValue();
   }

   /**
    * Returns the value of the specified number as a <code>int</code>.
    * This may involve rounding or truncation.
    *
    * @return  The numeric value represented by this object after conversion
    *          to type <code>int</code>.
    */
   public int intValue() {
      return (int)longValue();
   }

   /**
    * Returns the value of the specified number as a <code>float</code>.
    * This may involve rounding or truncation.
    *
    * @return  The numeric value represented by this object after conversion
    *          to type <code>float</code>.
    */
   public float floatValue() {
      return (float)doubleValue();
   }
}
