Class ExhaustiveGeoLocationNearestFinderImpl<D extends Comparable<? super D>>
java.lang.Object
rgu.transport.impl.ExhaustiveGeoLocationNearestFinderImpl<D>
- Type Parameters:
D- the edge type
- All Implemented Interfaces:
NearestFinder<GeoLocation>
public final class ExhaustiveGeoLocationNearestFinderImpl<D extends Comparable<? super D>>
extends Object
implements NearestFinder<GeoLocation>
Exhaustive search on a set of geo locations. Not exported as this requires defensive copy outside
the call. Can be bypassed when the underlying set is known to be unmodifiable.
-
Constructor Summary
ConstructorsConstructorDescriptionExhaustiveGeoLocationNearestFinderImpl(Metric<GeoLocation, D> metric, Collection<GeoLocation> elements, Predicate<D> filter) Creates a new instance of ExhaustiveGeoLocationNearestFinderImpl. -
Method Summary
Modifier and TypeMethodDescriptionnearest(GeoLocation target) Returns the element which is nearest to the specified target.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NearestFinder
cache, cache, concurrentCache, concurrentCache, nearest, nearest, nearestOrEmpty
-
Constructor Details
-
ExhaustiveGeoLocationNearestFinderImpl
public ExhaustiveGeoLocationNearestFinderImpl(Metric<GeoLocation, D> metric, Collection<GeoLocation> elements, Predicate<D> filter) Creates a new instance of ExhaustiveGeoLocationNearestFinderImpl.- Parameters:
metric- the distance metric, not nullelements- the elements, not null, reference will be maintained to this collection for read accessfilter- the filter for elements, not null, targets with no filter-accepted elements will be mapped to null
-
-
Method Details
-
nearest
Returns the element which is nearest to the specified target. Targets with no filter-accepted elements will be mapped to null.- Specified by:
nearestin interfaceNearestFinder<D extends Comparable<? super D>>- Parameters:
target- the target, not null- Returns:
- the nearest match, null if no filter-accepted elements exist
-