Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TreeMultimap in Google Collections

Tags:

java

guava

Has anybody used TreeMultimap in Google Collections? I understand that with a TreeMultimap, its keys and values are ordered by their natural ordering or by supplied comparators. I was wondering if there is a function that allows user to supply a key and returns all the values whose keys are greater than the user-supplied key. This can be done with a SortedMap in Java which has a function called tailMap. Thanks!

like image 701
flyingfromchina Avatar asked Dec 14 '22 01:12

flyingfromchina


1 Answers

I haven't used the TreeMultiMap class but a quick look at the Javadoc would suggest that you could use the asMap() method to get a SortedMap and then call tailMap() on that.

like image 154
Jared Russell Avatar answered Dec 24 '22 15:12

Jared Russell