jmetal.util
Class DistanceNodeComparator

java.lang.Object
  extended by jmetal.util.DistanceNodeComparator
All Implemented Interfaces:
java.util.Comparator

public class DistanceNodeComparator
extends java.lang.Object
implements java.util.Comparator

This class implements a Comparator to compare instances of DistanceNode.


Constructor Summary
DistanceNodeComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two DistanceNode.
 
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

DistanceNodeComparator

public DistanceNodeComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two DistanceNode.

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - Object representing a DistanceNode
o2 - Object representing a DistanceNode
Returns:
-1 if the distance of o1 is smaller than the distance of o2, 0 if the distance of both are equals, and 1 if the distance of o1 is bigger than the distance of o2