KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mockobjects > constraint > IsNot


1 /* Copyright (c) 2002 Nat Pryce. All rights reserved.
2  *
3  * Created on February 10, 2002, 11:35 PM
4  */

5 package com.mockobjects.constraint;
6
7
8 /** Calculates the logical negation of a constraint.
9  */

10 public class IsNot implements Constraint
11 {
12     private Constraint _predicate;
13     
14     public IsNot( Constraint p ) {
15         _predicate = p;
16     }
17     
18     public boolean eval( Object JavaDoc arg ) {
19         return !_predicate.eval(arg);
20     }
21     
22     public String JavaDoc toString() {
23         return "not " + _predicate;
24     }
25 }
26
Popular Tags