mathcomp.gridgeom
Class GeometricComparator

java.lang.Object
  extended by mathcomp.gridgeom.GeometricComparator
All Implemented Interfaces:
java.util.Comparator

public class GeometricComparator
extends java.lang.Object
implements java.util.Comparator

Lexicographic comparator of Geometric objects. GeometricWithNumber objects get special treatment. It is a singelton, use getDefault() to get it.

Author:
pht
See Also:
Geometric, GeometricWithNumber, Comparator, getDefault()

Method Summary
 int compare(Geometric g1, Geometric g2)
           
 int compare(java.lang.Object o1, java.lang.Object o2)
           
static int compareNodes(Node n1, Node n2)
           
static GeometricComparator getDefault()
           
static void testCompare(java.util.List l)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

getDefault

public static GeometricComparator getDefault()

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

compare

public int compare(Geometric g1,
                   Geometric g2)

compareNodes

public static int compareNodes(Node n1,
                               Node n2)

testCompare

public static void testCompare(java.util.List l)