1 11 package org.eclipse.jdt.internal.compiler.impl; 12 13 public class ByteConstant extends Constant { 14 private byte value; 15 16 public static Constant fromValue(byte value) { 17 return new ByteConstant(value); 18 } 19 private ByteConstant(byte value) { 20 this.value = value; 21 } 22 public byte byteValue() { 23 return this.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; } 43 public String stringValue() { 44 return String.valueOf(this.value) ; 46 } 47 public String toString(){ 48 49 return "(byte)" + value ; } public int typeID() { 51 return T_byte; 52 } 53 } 54 | Popular Tags |