gumbo.graphic.probe
Class AbstractPickEngine.GroupComparator

java.lang.Object
  |
  +--gumbo.graphic.probe.AbstractPickEngine.GroupComparator
All Implemented Interfaces:
java.util.Comparator
Enclosing class:
AbstractPickEngine

public static class AbstractPickEngine.GroupComparator
extends java.lang.Object
implements java.util.Comparator

A comparator for ordering groups (List) of ordered hits (HitResult) by group distance, from closest to farthest. Group distance is defined by the distance of the first hit in the group. If a group is empty its distance is assumed to be infinity.


Constructor Summary
AbstractPickEngine.GroupComparator(boolean sortAll)
          Creates an instance, as specified.
 
Method Summary
 int compare(java.lang.Object groupA, java.lang.Object groupB)
           
 
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
 

Constructor Detail

AbstractPickEngine.GroupComparator

public AbstractPickEngine.GroupComparator(boolean sortAll)
Creates an instance, as specified.

Parameters:
sortAll - If true, all groups are sorted (compare() never returns zero), with equal distance groups being sorted by hit hash code; otherwise, duplicate groups are eliminated.
Method Detail

compare

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