// -*- c++ -*-

/*
 * Jakelib2 - General purpose C++ library
 * Copyright (C) 2001 Florian Wolff  (florian@donuz.de)
 *
 * This library 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 library 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: Number.h,v 1.11 2003/09/13 08:46:07 florian Exp $
 */

#ifndef INCLUDE_JAKELIB2_LANG_NUMBER_H
# define INCLUDE_JAKELIB2_LANG_NUMBER_H

namespace jakelib {
  namespace lang {

    /**
     * This is the abstract super-class for all number value box classes.
     * It provides conversions methods from one number value type to
     * another.
     *
     * @class Number
     * @version $Id: Number.h,v 1.11 2003/09/13 08:46:07 florian Exp $
     * @author Florian 'Overflo' Wolff (florian@donuz.de)
     */
    class Number: public Object
    {
    public:
      /**
       * @brief Returns the number represented by this object converted to <tt>jjbyte</tt>.
       */
      virtual jbyte byteValue() = 0;

      /**
       * @brief Returns the number represented by this object converted to <tt>jdouble</tt>.
       */
      virtual jdouble doubleValue() = 0;

      /**
       * @brief Returns the number represented by this object converted to <tt>jfloat</tt>.
       */
      virtual jfloat floatValue() = 0;

      /**
       * @brief Returns the number represented by this object converted to <tt>jint</tt>.
       */
      virtual jint intValue() = 0;

      /**
       * @brief Returns the number represented by this object converted to <tt>jlong</tt>.
       */
      virtual jlong longValue() = 0;

      /**
       * @brief Returns the number represented by this object converted to <tt>jshort</tt>.
       */
      virtual jshort shortValue() = 0;

      JAKELIB_DECLARE_CLASS(Number);
    };
  }
}

#endif

