/** * Puts the key and value into the map, where the key must be a non-null * MultiKey object. * * @param key the non-null MultiKey object * @param value the value to store * @return the previous value for the key * @throws NullPointerException if the key is null * @throws ClassCastException if the key is not a MultiKey */ @Override public V put(final MultiKey<? extends K> key, final V value) { checkKey(key); return super.put(key, value); }
/** * Copies all of the keys and values from the specified map to this map. * Each key must be non-null and a MultiKey object. * * @param mapToCopy to this map * @throws NullPointerException if the mapToCopy or any key within is null * @throws ClassCastException if any key in mapToCopy is not a MultiKey */ @Override public void putAll(final Map<? extends MultiKey<? extends K>, ? extends V> mapToCopy) { for (final MultiKey<? extends K> key : mapToCopy.keySet()) { checkKey(key); } super.putAll(mapToCopy); }