示例#1
0
 /**
  * Adds the specified value to the specified key's list if it is not already in that list.
  *
  * @param key the key to associate the value with
  * @param value the value to be associated
  */
 public void put(T key, V value) {
   if (!map.containsKey(key)) map.put(key, new SortedList<>(valueComparator));
   SortedList<V> temp = map.get(key);
   if (!temp.contains(value)) {
     temp.add(value);
     map.put(key, temp);
   }
 }