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