1 11 package org.eclipse.jdt.internal.compiler.impl; 12 13 public class BooleanConstant extends Constant { 14 15 private boolean value; 16 17 private static final BooleanConstant TRUE = new BooleanConstant(true); 18 private static final BooleanConstant FALSE = new BooleanConstant(false); 19 20 public static BooleanConstant fromValue(boolean value) { 21 return value ? BooleanConstant.TRUE : BooleanConstant.FALSE; 22 } 23 private BooleanConstant(boolean value) { 24 this.value = value; 25 } 26 27 public boolean booleanValue() { 28 return value; 29 } 30 31 public String stringValue() { 32 return String.valueOf(this.value); 34 } 35 36 public String toString(){ 37 return "(boolean)" + value ; } 39 40 public int typeID() { 41 return T_boolean; 42 } 43 } 44 | Popular Tags |