1 package prefuse.data.expression; 2 3 import prefuse.data.Schema; 4 import prefuse.data.Tuple; 5 6 10 public class BooleanLiteral extends Literal implements Predicate 11 { 12 13 public static final BooleanLiteral TRUE = new BooleanLiteral(true); 14 15 public static final BooleanLiteral FALSE = new BooleanLiteral(false); 16 17 private final boolean m_value; 18 19 23 public BooleanLiteral(boolean b) { 24 m_value = b; 25 } 26 27 30 public boolean getBoolean(Tuple tuple) { 31 return m_value; 32 } 33 34 37 public Class getType(Schema s) { 38 return boolean.class; 39 } 40 41 44 public Object get(Tuple t) { 45 return ( getBoolean(t) ? Boolean.TRUE : Boolean.FALSE ); 46 } 47 48 51 public String toString() { 52 return String.valueOf(m_value).toUpperCase(); 53 } 54 55 } | Popular Tags |