Class DoubleMap<K1,​K2,​V>


  • @Deprecated
    public class DoubleMap<K1,​K2,​V>
    extends java.lang.Object
    Deprecated.
    Provides simple get and put access to a Map like object with a double key that allows either or both keys to be a wild card that matches any value. May not contain null keys or values.

    Originally created for mapping source and target mimetypes to transformer configuration data.

    For example:

           DoubleMap foodLikes = 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"
     
    Author:
    Alan Davis
    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleMap​(K1 anyKey1, K2 anyKey2)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      V get​(K1 key1, K2 key2)
      Deprecated.
      Returns a value for the given keys.
      V getNoWildcards​(K1 key1, K2 key2)
      Deprecated.
      Returns a value for the given keys without using wildcards.
      void put​(K1 key1, K2 key2, V t)
      Deprecated.
      Adds a value for the given keys.
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DoubleMap

        public DoubleMap​(K1 anyKey1,
                         K2 anyKey2)
        Deprecated.
    • Method Detail

      • get

        public V get​(K1 key1,
                     K2 key2)
        Deprecated.
        Returns a value for the given keys.
      • getNoWildcards

        public V getNoWildcards​(K1 key1,
                                K2 key2)
        Deprecated.
        Returns a value for the given keys without using wildcards.
      • put

        public void put​(K1 key1,
                        K2 key2,
                        V t)
        Deprecated.
        Adds a value for the given keys.
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object