Package org.hipparchus.complex
Class ComplexComparator
- java.lang.Object
-
- org.hipparchus.complex.ComplexComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<Complex>
public class ComplexComparator extends Object implements Comparator<Complex>, Serializable
Comparator for Complex Numbers.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComplexComparator()
Empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Complex o1, Complex o2)
Compare two complex numbers, using real ordering as the primary sort order and imaginary ordering as the secondary sort order.-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Complex o1, Complex o2)
Compare two complex numbers, using real ordering as the primary sort order and imaginary ordering as the secondary sort order.- Specified by:
compare
in interfaceComparator<Complex>
- Parameters:
o1
- first complex numbero2
- second complex number- Returns:
- a negative value if o1 real part is less than o2 real part or if real parts are equal and o1 imaginary part is less than o2 imaginary part
-
-