Thanks for your input everyone.
In my instance I want to an immutable won't help because I need to be
able to add more entries.
The iteration order of normal vs inverse doesn't actually bother me. I
just need to know that the ordering is consistent between iterations.
In my case I need to be able to look up values by key, keys by value
and also to be able to provide a list of key/values pairs from
position x to y.
I might just use store all my data in both a List and a BiMap.
Cheers,
Peter
On Jun 7, 10:43 pm, Kevin Bourrillion <
kev...@google.com> wrote:
> Ah, I forgot about that complication. It can be weird to have entries
> iterate in a completely different order on the inverse from the, erm,
> obverse(?).
>
> And right: Immutable is very often the answer.
>
> On Thu, Jun 7, 2012 at 5:39 AM, Louis Wasserman
> <
wasserman.lo...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > ImmutableBiMap maintains insertion order.
>
> > Part of the difficulty in a mutable, insertion-ordered BiMap is that
> > keeping the order consistent in both directions is quite tricky and
> > requires a lot of thought.
>
> > Louis Wasserman
> >
wasserman.lo...@gmail.com
> >
http://profiles.google.com/wasserman.louis
> >> To get help:
http://stackoverflow.com/questions/ask(use the tag "guava")
> > To get help:
http://stackoverflow.com/questions/ask(use the tag "guava")