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