Hi Eric,

> Would Java’s Map.entrySet provide the “getEntry” type method needed?
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#entrySet--
> Or would this provide all entry’s and still need to find the specific entry 
> so maybe a forEach variation to filter for a specific entry?
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#forEach-java.util.function.BiConsumer-

This would work but it would require iterating through half of the set
on average in order to find the correct entry, meaning we would lose
the performance benefits of the spatial data structure. The
PointMap.getEntry() method currently in the PR avoids this iteration
requirement.

Regards,
Matt

On Sun, Mar 20, 2022 at 9:13 AM Eric Bresie <ebre...@gmail.com> wrote:
>
>
>
>
> On March 14, 2022 at 10:19:14 AM CDT, Matt Juntunen 
> <matt.a.juntu...@gmail.com> wrote:
>
> I'm a little bit confused: Isn't it always the case that
>
> getEntry(p).getKey()
> will return the originally inserted (i.e. "canonical") point (i.e. not "p")?
>
> Map does not contain a "getEntry" method. If it did, that would indeed
> be preferable.
>
>
> Would Java’s Map.entrySet provide the “getEntry” type method needed?
>
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#entrySet--
>
> Or would this provide all entry’s and still need to find the specific entry 
> so maybe a forEach variation to filter for a specific entry?
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#forEach-java.util.function.BiConsumer-
>
> Unless I'm missing a standard use-case, the specialized methods
>
> "closestFirst" and "farthestFirst" don't seem useful (and wasteful
> of computing resources: If iterating over the whole set, why would
> one want to start from some particular point?).
>
>
> Eric Bresie
> ebre...@gmail.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to