The standard library LinkedHashSet
is a HashSet
that provides insertion-order iteration. Is there a version of Guava's BiMap
that maintains insertion-order iteration on keys and values? I do need the BiMap
to be mutable, so ImmutableBiMap
is not sufficient for my purpose.
Is there a BiMap implementation with predictable iteration ordering (insertion order)?
1k Views Asked by Jake Cobb At
2
The only available implementation is
ImmutableBiMap<K,V>
. You can check the implementations here. You can use aLinkedHashMap
and convert it to withcopyOf(Map<? extends K,? extends V> map)
to make it anImmutableBiMap<K,V>
. Will it work for you?