-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for NavigableMap in Long2ObjectAVLTreeMap and the like is missing #128
Comments
If this was implemented it would make SortedPools at least makeable with FastUtil. Right now you are forced to use java Implementations because its impossible with fastUtil. |
Why the lack of support for obviously needed floor keyed methods in SortedMap? These are essential for efficiently finding things in a sparse array of things and finding the floor thing of varying sized things, in a non-sparse array. I note that in java.util.NavigableMap, has these methods:
.. but annoyingly omits these obvious methods:
I appreciate that you may not want to implement NavigableMap, but maybe should, however please at least add at least a typed version of floorKey (e.g. floorIntKey) to the typed *SortedMap interfaces and their implementations, to avoid the inefficiency of having to call subMap when only the floorKey, and possibly the value are needed. |
You lost me at "stupid". |
I updated, it to make more sense, |
Just some questions:
|
From the NavigableMap JavaDoc:
Indeed it should be easy to add floor* methods for a data structure with ordered keys. As revealed by SortedMap JavaDoc excerpt below,
|
What I was asking is a semantic description of
|
The 1st suggestion is useless if you need to specify both a lower and higher key, like a A major reason why this library appears to exists are to provide better typed support for primitive key and/or value data structures, so the comment about iterators and size() is puzzling. After further work on my approach, now using ordered key and data arrays, with Anyhow, my approach works, so I doubt that I'll comment any further on this issue. |
I still don't know what |
I was mistaken about the need for a floorMap method, only a floorKey method is useful, because I now see no benefit in creating a view of the map for offset key range use. |
It can be useful if you want to have somewhat of a savestate of iteration. |
A
To do bounded navigation, it is necessary to detect when at the |
This is not an issue but a feature request. It would be nice to have functions from NavigableMap interface in RBTree and AVLTree-based maps and sets classes. For example, {ceiling,floor,higher,lower}{Entry,Key} functions. See here https://docs.oracle.com/javase/8/docs/api/java/util/NavigableMap.html for the reference.
The text was updated successfully, but these errors were encountered: