1 package uk.co.jezuk.mango.binarypredicates;2 3 /**4 * <code>BinaryPredicate</code> that returns true if <code>x</code> is greater than <code>y</code>.5 * <code>x</code> and <code>y</code> must implement the <code>java.lang.Comparable<code> interface.6 * @author Jez Higgins, jez@jezuk.co.uk7 * @version $Id: GreaterThan.java 51 2002-06-11 18:43:59Z jez $8 */9 public class GreaterThan implements uk.co.jezuk.mango.BinaryPredicate10 {11 /**12 * @return <code>true</code> if <code>x.compareTo(y) > 0</code> 13 */14 public boolean test(Object x, Object y)15 {16 if(x == null)17 return false;18 if(y == null)19 return true;20 21 return ((Comparable )x).compareTo(y) > 0;22 } // test23 } // GreaterThan24 25