1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package net
.multiphasicapps
.classfile
;
13 * This represents a constant value which is a number.
17 public abstract class ConstantValueNumber
20 /** The number used. */
21 protected final Number value
;
24 * Initializes the constant value that uses a number.
26 * @param __v The value.
27 * @param __t The type of value used.
28 * @throws NullPointerException On null arguments.
31 public ConstantValueNumber(Number __v
, ConstantValueType __t
)
32 throws NullPointerException
37 throw new NullPointerException("NARG");
43 * Returns the double value.
45 * @return The double value.
48 public final double doubleValue()
50 return this.value
.doubleValue();
54 * Returns the float value.
56 * @return The float value.
59 public final float floatValue()
61 return this.value
.floatValue();
65 * Returns the integer value.
67 * @return The integer value.
70 public final int intValue()
72 return this.value
.intValue();
76 * Returns the long value.
78 * @return The long value.
81 public final long longValue()
83 return this.value
.longValue();
87 * Returns the value as a number.
89 * @return The number used.
92 public final Number
number()