Package com.softsynth.jmsl
Class CompareDim
java.lang.Object
com.softsynth.jmsl.CompareDim
- All Implemented Interfaces:
DimensionComparison
public class CompareDim extends java.lang.Object implements DimensionComparison
Used to sort shapes. A simple compare that compares values in specified dimension of two elements of a Shape.
- Author:
- Phil Burk and Nick Didkovsky
-
Constructor Summary
Constructors Constructor Description CompareDim()
-
Method Summary
Modifier and Type Method Description int
compare(double[] e1, double[] e2, int dim)
Returns -1 if e1[dim] lt e2[dim], 0 if e1[dim] eq e2[dim], 1 if e1[dim] gt e2[dim]Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CompareDim
public CompareDim()
-
-
Method Details
-
compare
public int compare(double[] e1, double[] e2, int dim)Returns -1 if e1[dim] lt e2[dim], 0 if e1[dim] eq e2[dim], 1 if e1[dim] gt e2[dim]- Specified by:
compare
in interfaceDimensionComparison
- Returns:
- -1 if (e1 lt e2), 0 if (e1 eq e2), 1 if (e1 gt e2)
-