gov.sandia.cognition.collection
Class NumberComparator

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.collection.NumberComparator
All Implemented Interfaces:
CloneableSerializable, Serializable, Cloneable, Comparator<Number>

public class NumberComparator
extends AbstractCloneableSerializable
implements Comparator<Number>

Compares two Numbers (base class of Double, Integer, etc.) for sorting.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static NumberComparator INSTANCE
          Instance of the NumberComparator.
 
Constructor Summary
NumberComparator()
          Creates a new instance of NumberComparator
 
Method Summary
 int compare(Number o1, Number o2)
           
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

INSTANCE

public static final NumberComparator INSTANCE
Instance of the NumberComparator.

Constructor Detail

NumberComparator

public NumberComparator()
Creates a new instance of NumberComparator

Method Detail

compare

public int compare(Number o1,
                   Number o2)
Specified by:
compare in interface Comparator<Number>