1 package prefuse.data.expression; 2 3 import prefuse.data.Tuple; 4 5 10 public class NotPredicate extends AbstractPredicate { 11 12 private Predicate m_predicate; 13 14 18 public NotPredicate(Predicate p) { 19 m_predicate = p; 20 } 21 22 26 public Predicate getPredicate() { 27 return m_predicate; 28 } 29 30 33 public boolean getBoolean(Tuple t) { 34 return !m_predicate.getBoolean(t); 35 } 36 37 40 public void visit(ExpressionVisitor v) { 41 v.visitExpression(this); 42 v.down(); 43 m_predicate.visit(v); 44 v.up(); 45 } 46 47 50 public String toString() { 51 return "NOT "+m_predicate.toString(); 52 } 53 54 57 protected void addChildListeners() { 58 m_predicate.addExpressionListener(this); 59 } 60 61 64 protected void removeChildListeners() { 65 m_predicate.removeExpressionListener(this); 66 } 67 68 } | Popular Tags |