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)
-
Comparer()
-
-
equals(Object, Object)
- Returns true if the leftOperand is equal to the rightOperand.
-
greaterThan(Object, Object)
- Returns true if the leftOperand is greater than the rightOperand.
-
greaterThanOrEqual(Object, Object)
- Returns true if the leftOperand is greater than or equal the rightOperand.
-
lessThan(Object, Object)
- Returns true if the leftOperand is less than the rightOperand.
-
lessThanOrEqual(Object, Object)
- Returns true if the leftOperand is less than or equal to the rightOperand.
Comparer
public Comparer()
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.
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.
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.
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.
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