Package org.uma.jmetal.util.comparator
Class LexicographicalVectorComparator
java.lang.Object
org.uma.jmetal.util.comparator.LexicographicalVectorComparator
- All Implemented Interfaces:
Comparator<double[]>
This class implements the Comparator interface for comparing two vectors.
The order used is lexicographical numerical order.
- Author:
- Antonio J. Nebro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(double[] x, double[] y) The compare method compare the objects o1 and o2.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
LexicographicalVectorComparator
public LexicographicalVectorComparator()
-
-
Method Details
-
compare
public int compare(double[] x, double[] y) The compare method compare the objects o1 and o2.- Specified by:
comparein interfaceComparator<double[]>- Parameters:
x- Vector (array) of double valuesy- Vector (array) of double values- Returns:
- The following value: -1 if x invalid input: '<' y, 1 if x > y or 0 otherwise.
-