Package pal.util

Interface Comparator


public interface Comparator
interface for an object that can compare other objects for the purposes of ordering them. This interface is analogous to the Comparator interface in Java 1.2 and higher, and it should be superceded by the collections framework when PAL is moved to 1.2 or higher.
Version:
$Id: Comparator.java,v 1.2 2001/07/13 14:39:13 korbinian Exp $
Author:
Alexei Drummond
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns a number representing the ordering relationship that the two objects have.
    boolean
    equals(Object o1, Object o2)
    Returns true if the two objects are equal.
  • Method Details

    • compare

      int compare(Object o1, Object o2)
      Returns a number representing the ordering relationship that the two objects have. A negative number indicates that the first object is "smaller" than the second object, a positive number means it is "larger" and zero indicates that the objects are equal.
    • equals

      boolean equals(Object o1, Object o2)
      Returns true if the two objects are equal.