All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.compare.Comparer

java.lang.Object
   |
   +----sdsu.compare.Comparer

public abstract class Comparer
extends Object
This abstract class defines an interface for comparing objects. You only need to override the compare method, as the default implementation of all other methods use compare. However, for effeciency reasons you may wish to override more than compare.

Author:
Roger Whitney (whitney@cs.sdsu.edu)

Constructor Index

 o Comparer()

Method Index

 o equals(Object, Object)
Returns true if the leftOperand is equal to the rightOperand.
 o greaterThan(Object, Object)
Returns true if the leftOperand is greater than the rightOperand.
 o greaterThanOrEqual(Object, Object)
Returns true if the leftOperand is greater than or equal the rightOperand.
 o lessThan(Object, Object)
Returns true if the leftOperand is less than the rightOperand.
 o lessThanOrEqual(Object, Object)
Returns true if the leftOperand is less than or equal to the rightOperand.

Constructors

 o Comparer
 public Comparer()

Methods

 o lessThan
 public abstract boolean lessThan(Object leftOperand,
                                  Object rightOperand) throws ClassCastException
Returns true if the leftOperand is less than the rightOperand.

Throws: ClassCastException
If operand objects are not proper type. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
 o greaterThan
 public abstract boolean greaterThan(Object leftOperand,
                                     Object rightOperand) throws ClassCastException
Returns true if the leftOperand is greater than the rightOperand.

Throws: ClassCastException
If operand objects are not proper type. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
 o equals
 public abstract boolean equals(Object leftOperand,
                                Object rightOperand) throws ClassCastException
Returns true if the leftOperand is equal to the rightOperand.

Throws: ClassCastException
If operand objects are not proper type. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
 o lessThanOrEqual
 public boolean lessThanOrEqual(Object leftOperand,
                                Object rightOperand) throws ClassCastException
Returns true if the leftOperand is less than or equal to the rightOperand.

Throws: ClassCastException
If operand objects are not proper type. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
 o greaterThanOrEqual
 public boolean greaterThanOrEqual(Object leftOperand,
                                   Object rightOperand) throws ClassCastException
Returns true if the leftOperand is greater than or equal the rightOperand.

Throws: ClassCastException
If operand objects are not proper type. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.

All Packages  Class Hierarchy  This Package  Previous  Next  Index