I would like to have a c.g.c.c.Multimap
that is sorted based on keys only. The values shouldn\'t be sorted. I\'ve tried to build something with guava\'s T
Though the OP's specific situation seems to have been answered using immutable multimap building functions, I needed a mutable version of what he was asking for. In case it helps anyone, here's the generic method I ended up creating:
static Multimap newTreeArrayListMultimap(
final int expectedValuesPerKey)
{
return Multimaps.newMultimap(new TreeMap>(),
new Supplier>()
{
@Override
public Collection get()
{
return new ArrayList(expectedValuesPerKey);
}
});
}