KickJava   Java API By Example, From Geeks To Geeks.

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


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 /** Is the value less than another {@link java.lang.Comparable} value?
9  */

10 public class IsLessThan implements Constraint
11 {
12     private Comparable JavaDoc _object;
13     
14     public IsLessThan(Comparable JavaDoc o) {
15         _object = o;
16     }
17     
18     public boolean eval( Object JavaDoc arg ) {
19         return _object.compareTo(arg) > 0;
20     }
21     
22     public String JavaDoc toString() {
23         return "a value less than <" + _object + ">";
24     }
25 }
26
Popular Tags