com.softsynth.jmsl
Class CompareDim

java.lang.Object
  extended by 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
CompareDim()
           
 
Method Summary
 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 Detail

CompareDim

public CompareDim()
Method Detail

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 interface DimensionComparison
Returns:
-1 if (e1 lt e2), 0 if (e1 eq e2), 1 if (e1 gt e2)