com.partnersoft.geometry.xy
Class XyClosestPointFinder

java.lang.Object
  extended by com.partnersoft.geometry.xy.XyClosestPointFinder

public class XyClosestPointFinder
extends java.lang.Object

Data structure and algorithm to handle closest-point matching.

If you need to associate keys with points, just use a HashMap, then use the results from this to look up your keys. This won't always work (e.g. if you have multiple keys mapping to the same or equivalent XyPoint), but it keeps this implementation simple.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
XyClosestPointFinder()
           
XyClosestPointFinder(java.util.Collection<XyPoint> points, double maximumDistance)
           
XyClosestPointFinder(double maximumDistance)
           
 
Method Summary
 XyPoint closestPointTo(XyPoint point)
           
 double getMaximumDistanceSquared()
           
 void setMaximumDistanceSquared(double maximumDistanceSquared)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XyClosestPointFinder

public XyClosestPointFinder()

XyClosestPointFinder

public XyClosestPointFinder(double maximumDistance)

XyClosestPointFinder

public XyClosestPointFinder(java.util.Collection<XyPoint> points,
                            double maximumDistance)
Method Detail

getMaximumDistanceSquared

public double getMaximumDistanceSquared()

setMaximumDistanceSquared

public void setMaximumDistanceSquared(double maximumDistanceSquared)

closestPointTo

public XyPoint closestPointTo(XyPoint point)