/** * Maps the specified key to the specified value. * * @param key * the key. * @param value * the value. * @return the value of any previous mapping with the specified key or * {@code null} if there was no mapping. * @throws UnsupportedOperationException * if adding to this map is not supported. * @throws ClassCastException * if the class of the key or value is inappropriate for this * map. * @throws IllegalArgumentException * if the key or value cannot be added to this map. * @throws NullPointerException * if the key or value is {@code null} and this {@code EnumMap} does not * support {@code null} keys or values. */ @Override @SuppressWarnings("unchecked") public V put(K key, V value) { return putImpl(key, value); }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
/** * Maps the specified key to the specified value. * * @param key * the key. * @param value * the value. * @return the value of any previous mapping with the specified key or * {@code null} if there was no mapping. * @throws UnsupportedOperationException * if adding to this map is not supported. * @throws ClassCastException * if the class of the key or value is inappropriate for this * map. * @throws IllegalArgumentException * if the key or value cannot be added to this map. * @throws NullPointerException * if the key or value is {@code null} and this {@code EnumMap} does not * support {@code null} keys or values. */ @Override @SuppressWarnings("unchecked") public V put(K key, V value) { return putImpl(key, value); }
/** * Maps the specified key to the specified value. * * @param key * the key. * @param value * the value. * @return the value of any previous mapping with the specified key or * {@code null} if there was no mapping. * @throws UnsupportedOperationException * if adding to this map is not supported. * @throws ClassCastException * if the class of the key or value is inappropriate for this * map. * @throws IllegalArgumentException * if the key or value cannot be added to this map. * @throws NullPointerException * if the key or value is {@code null} and this {@code EnumMap} does not * support {@code null} keys or values. */ @Override @SuppressWarnings("unchecked") public V put(K key, V value) { return putImpl(key, value); }
/** * Maps the specified key to the specified value. * * @param key * the key. * @param value * the value. * @return the value of any previous mapping with the specified key or * {@code null} if there was no mapping. * @throws UnsupportedOperationException * if adding to this map is not supported. * @throws ClassCastException * if the class of the key or value is inappropriate for this * map. * @throws IllegalArgumentException * if the key or value cannot be added to this map. * @throws NullPointerException * if the key or value is {@code null} and this {@code EnumMap} does not * support {@code null} keys or values. */ @Override @SuppressWarnings("unchecked") public V put(K key, V value) { return putImpl(key, value); }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void putAllImpl(Map map) { Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); putImpl((K) entry.getKey(), (V) entry.getValue()); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }
@SuppressWarnings("unchecked") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); initialization(keyType); int elementCount = stream.readInt(); Enum<K> enumKey; Object value; for (int i = elementCount; i > 0; i--) { enumKey = (Enum<K>) stream.readObject(); value = stream.readObject(); putImpl((K) enumKey, (V) value); } }