1 28 29 package com.caucho.jmx.query; 30 31 34 public class BooleanValueExp extends AbstractValueExp { 35 private static BooleanValueExp TRUE = new BooleanValueExp(true); 36 private static BooleanValueExp FALSE = new BooleanValueExp(false); 37 38 private boolean _value; 39 40 43 private BooleanValueExp(boolean value) 44 { 45 _value = value; 46 } 47 48 51 public static BooleanValueExp create(boolean value) 52 { 53 return value ? TRUE : FALSE; 54 } 55 56 59 public String getString() 60 { 61 return String.valueOf(_value); 62 } 63 64 67 public boolean getBoolean() 68 { 69 return _value; 70 } 71 72 75 public long getLong() 76 { 77 return _value ? 1 : 0; 78 } 79 80 83 public double getDouble() 84 { 85 return _value ? 1 : 0; 86 } 87 88 91 public String toString() 92 { 93 return String.valueOf(_value); 94 } 95 } 96 | Popular Tags |