Frage

Recently i started using apache commons MultiKeyMap for some of my projects and in there i can have multiple values for a value.

MultiKeyMap typePanelUnoMap = new MultiKeyMap();

Here i want to know whether we can preserve insertion order by using MultiKeyMap. I know that java.util LinkedHashMap can preserve the insertion order.

Map hshmap = new LinkedHashMap()

Can i have the same functionality on MultiKeyMap?

Thanks, Keth

War es hilfreich?

Lösung

from the javadocs

This map is implemented as a decorator of a AbstractHashedMap which enables extra behaviour to be added easily.

MultiKeyMap.decorate(new LinkedMap()) creates an ordered map.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top