1 11 package org.eclipse.jdt.internal.compiler.impl; 12 13 public class FloatConstant extends Constant { 14 15 float value; 16 17 public static Constant fromValue(float value) { 18 return new FloatConstant(value); 19 } 20 21 private FloatConstant(float value) { 22 this.value = value; 23 } 24 25 public byte byteValue() { 26 return (byte) value; 27 } 28 29 public char charValue() { 30 return (char) value; 31 } 32 33 public double doubleValue() { 34 return value; } 36 37 public float floatValue() { 38 return this.value; 39 } 40 41 public int intValue() { 42 return (int) value; 43 } 44 45 public long longValue() { 46 return (long) value; 47 } 48 49 public short shortValue() { 50 return (short) value; 51 } 52 53 public String stringValue() { 54 return String.valueOf(this.value); 55 } 56 57 public String toString() { 58 return "(float)" + value; } 60 61 public int typeID() { 62 return T_float; 63 } 64 } 65 | Popular Tags |