diff options
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java new file mode 100644 index 0000000000..8fca6c6214 --- /dev/null +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IntConstant.java @@ -0,0 +1,56 @@ +package org.eclipse.jdt.internal.compiler.impl;
+
+public class IntConstant extends Constant {
+ int value;
+ public IntConstant(int value) {
+ this.value = value;
+ }
+
+ public byte byteValue() {
+ return (byte) value;
+ }
+
+ public char charValue() {
+ return (char) value;
+ }
+
+ public double doubleValue() {
+ return (double) value;
+ }
+
+ public float floatValue() {
+ return (float) value;
+ }
+
+ public int intValue() {
+ return (int) value;
+ }
+
+ public long longValue() {
+ return (long) value;
+ }
+
+ public short shortValue() {
+ return (short) value;
+ }
+
+ public String stringValue() {
+ //spec 15.17.11
+
+ String s = new Integer(value).toString();
+ if (s == null)
+ return "null";
+ else
+ return s;
+ }
+
+ public String toString() {
+
+ return "(int)" + value;
+ }
+
+ public int typeID() {
+ return T_int;
+ }
+
+}
|