Is there a way to get a bidirectionnal iterator over a TreeMap
, ie an iterator[(A,B)]
with hasPrevious
, previous
methods completing the hasNext
, next
methods ?
I know it does not exists natively in scala but I have some hope some trick could make it possible via some java adapters/facade/wrappers.
TreeMap provides the navigableKeySet() method which returns a NavigableSet which provides a descendingIterator().
Not certain how you would work with that in Scala
though.