net.datastructures - version 5.0

net.datastructures
Class DefaultComparator<E>

java.lang.Object
  extended by net.datastructures.DefaultComparator<E>
All Implemented Interfaces:
Comparator<E>

public class DefaultComparator<E>
extends Object
implements Comparator<E>

Comparator based on the natural ordering

Author:
Michael Goodrich

Constructor Summary
DefaultComparator()
           
 
Method Summary
 int compare(E a, E b)
          Compares two given elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DefaultComparator

public DefaultComparator()
Method Detail

compare

public int compare(E a,
                   E b)
            throws ClassCastException
Compares two given elements

Specified by:
compare in interface Comparator<E>
Returns:
a negative integer if a is less than b, zero if a equals b, or a positive integer if a is greater than b
Throws:
ClassCastException

net.datastructures - version 5.0