sdsu.compare
Class LongComparer

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

public class LongComparer
extends Comparer

A concrete class for comparing Numeric objects which contain values that can be converted to a long.

Version:
1.0 4 June 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
Serialized Form

Method Summary
 boolean equals(java.lang.Object leftOperand, java.lang.Object rightOperand)
          Returns true if the leftOperand is equal to the rightOperand.
static Comparer getInstance()
          Returns a LongComparer object.
 boolean greaterThan(java.lang.Object leftOperand, java.lang.Object rightOperand)
          Returns true if the leftOperand is greater than the rightOperand.
 boolean lessThan(java.lang.Object leftOperand, java.lang.Object rightOperand)
          Returns true if the leftOperand is less than the rightOperand.
 
Methods inherited from class sdsu.compare.Comparer
greaterThanOrEqual, lessThanOrEqual
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Comparer getInstance()
Returns a LongComparer object.

lessThan

public final boolean lessThan(java.lang.Object leftOperand,
                              java.lang.Object rightOperand)
                       throws java.lang.ClassCastException
Returns true if the leftOperand is less than the rightOperand.
Throws:
java.lang.ClassCastException - If operand objects are not Number objects. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
Overrides:
lessThan in class Comparer

greaterThan

public final boolean greaterThan(java.lang.Object leftOperand,
                                 java.lang.Object rightOperand)
                          throws java.lang.ClassCastException
Returns true if the leftOperand is greater than the rightOperand.
Throws:
java.lang.ClassCastException - If operand objects are not Number objects. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
Overrides:
greaterThan in class Comparer

equals

public final boolean equals(java.lang.Object leftOperand,
                            java.lang.Object rightOperand)
                     throws java.lang.ClassCastException
Returns true if the leftOperand is equal to the rightOperand.
Throws:
java.lang.ClassCastException - If operand objects are not Number objects. ClassCastException is a RuntimeException, so compiler does not force you to catch this exception.
Overrides:
equals in class Comparer