N
nooneinparticular314159
Hello. I am storing some data in a TreeMap, and I need to get a subset
of that data. Conveniently, I can get exactly the data I want using
tailmap, which returns a SortedMap. Not so conveniently, I need to get
my objects out of the SortedMap, which seems to require knowing what
the keys are that are used to index the SortedMap. I don't necessarily
know what these keys are. Nothing that I've tried has given me the
actual keys. Is there a way to get the keys out of a SortedMap?
Alternately, is there a way to iterate over the elements in a
SortedMap? I don't think that I can get the first or last element and
remove it, because that will destroy the object backing the map.
Thanks,
Michael
of that data. Conveniently, I can get exactly the data I want using
tailmap, which returns a SortedMap. Not so conveniently, I need to get
my objects out of the SortedMap, which seems to require knowing what
the keys are that are used to index the SortedMap. I don't necessarily
know what these keys are. Nothing that I've tried has given me the
actual keys. Is there a way to get the keys out of a SortedMap?
Alternately, is there a way to iterate over the elements in a
SortedMap? I don't think that I can get the first or last element and
remove it, because that will destroy the object backing the map.
Thanks,
Michael