KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > visual > expression > ValidatedPredicate


1 package prefuse.visual.expression;
2
3 import prefuse.data.expression.ColumnExpression;
4 import prefuse.data.expression.Expression;
5 import prefuse.data.expression.Function;
6 import prefuse.data.expression.NotPredicate;
7 import prefuse.data.expression.Predicate;
8 import prefuse.visual.VisualItem;
9
10 /**
11  * Expression that indicates if an item's validated flag is set.
12  *
13  * @author <a HREF="http://jheer.org">jeffrey heer</a>
14  */

15 public class ValidatedPredicate extends ColumnExpression
16     implements Predicate, Function
17 {
18     /** Convenience instance for the validated == true case. */
19     public static final Predicate TRUE = new ValidatedPredicate();
20     /** Convenience instance for the validated == false case. */
21     public static final Predicate FALSE = new NotPredicate(TRUE);
22     
23     /**
24      * Create a new ValidatedPredicate.
25      */

26     public ValidatedPredicate() {
27         super(VisualItem.VALIDATED);
28     }
29     
30     /**
31      * @see prefuse.data.expression.Function#getName()
32      */

33     public String JavaDoc getName() {
34         return "VALIDATED";
35     }
36
37     /**
38      * @see prefuse.data.expression.Function#addParameter(prefuse.data.expression.Expression)
39      */

40     public void addParameter(Expression e) {
41         throw new IllegalStateException JavaDoc("This function takes 0 parameters");
42     }
43
44     /**
45      * @see prefuse.data.expression.Function#getParameterCount()
46      */

47     public int getParameterCount() {
48         return 0;
49     }
50     
51     /**
52      * @see java.lang.Object#toString()
53      */

54     public String JavaDoc toString() {
55         return getName()+"()";
56     }
57
58 } // end of class ValidatedPredicate
59
Popular Tags