public class DoubleMap<K1,K2,V> extends Object
Originally created for mapping source and target mimetypes to transformer configuration data.
For example:
DoubleMapfoodLikes = new DoubleMap ("*", "*"); foodLikes.put("cat", "mouse", "likes"); foodLikes.get("cat", "mouse"); // returns "likes" foodLikes.get("cat", "meat"); // returns null foodLikes.put("dog", "meat", "likes"); foodLikes.put("dog", "stick", "unsure"); foodLikes.put("child", "olive", "dislikes"); foodLikes.put("bird", "*", "worms only"); foodLikes.put("*", "meat", "unknown"); foodLikes.put("*", "*", "no idea at all"); foodLikes.get("cat", "mouse"); // returns "likes" foodLikes.get("cat", "meat"); // returns "unknown" foodLikes.get("cat", "tea"); // returns "unknown" foodLikes.get("*", "mouse"); // returns "no idea at all" foodLikes.get("dog", "*"); // returns "no idea at all" foodLikes.get("bird","*"); // returns "worms only" foodLikes.get("bird","tea"); // returns "worms only"
Modifier and Type | Method and Description |
---|---|
V |
get(K1 key1,
K2 key2)
Returns a value for the given keys.
|
V |
getNoWildcards(K1 key1,
K2 key2)
Returns a value for the given keys without using wildcards.
|
void |
put(K1 key1,
K2 key2,
V t)
Adds a value for the given keys.
|
String |
toString() |
Copyright © 2005–2017 Alfresco Software. All rights reserved.