org.simbrain.util
Class Comparator

java.lang.Object
  extended by org.simbrain.util.Comparator
All Implemented Interfaces:
Comparator

public class Comparator
extends Object
implements Comparator

Comparator is used to compare positions of PNodes.


Field Summary
static int COMPARE_X
          Compare PNodes by their x dimension.
static int COMPARE_Y
          Compare PNodes by their y dimension.
 
Constructor Summary
Comparator(int comparison)
          Constructor for Comparator.
 
Method Summary
 int compare(Object o1, Object o2)
           
 
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
 

Field Detail

COMPARE_X

public static final int COMPARE_X
Compare PNodes by their x dimension.

See Also:
Constant Field Values

COMPARE_Y

public static final int COMPARE_Y
Compare PNodes by their y dimension.

See Also:
Constant Field Values
Constructor Detail

Comparator

public Comparator(int comparison)
Constructor for Comparator.

Parameters:
comparison - whether to compare by x or y dimension.
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator
See Also:
Comparator