Remove exported everywhere.
[SquirrelJME.git] / modules / tool-classfile / src / main / java / net / multiphasicapps / classfile / ConstantValueNumber.java
blob6e89a99d666ce69beba9ca312a7a59ab3ca0662b
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
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;
12 /**
13 * This represents a constant value which is a number.
15 * @since 2018/05/21
17 public abstract class ConstantValueNumber
18 extends ConstantValue
20 /** The number used. */
21 protected final Number value;
23 /**
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.
29 * @since 2018/05/21
31 public ConstantValueNumber(Number __v, ConstantValueType __t)
32 throws NullPointerException
34 super(__v, __t);
36 if (__v == null)
37 throw new NullPointerException("NARG");
39 this.value = __v;
42 /**
43 * Returns the double value.
45 * @return The double value.
46 * @since 2018/05/16
48 public final double doubleValue()
50 return this.value.doubleValue();
53 /**
54 * Returns the float value.
56 * @return The float value.
57 * @since 2018/05/16
59 public final float floatValue()
61 return this.value.floatValue();
64 /**
65 * Returns the integer value.
67 * @return The integer value.
68 * @since 2018/05/16
70 public final int intValue()
72 return this.value.intValue();
75 /**
76 * Returns the long value.
78 * @return The long value.
79 * @since 2018/05/16
81 public final long longValue()
83 return this.value.longValue();
86 /**
87 * Returns the value as a number.
89 * @return The number used.
90 * @since 2018/05/21
92 public final Number number()
94 return this.value;