@Override public boolean add(K e) {return AbstractMap.this.addKey(e);} @Override public Iterator<K> iterator() {
@Override public boolean add(V e) {return AbstractMap.this.addValue(e);} @Override public Iterator<V> iterator() {
@Override public void clear() { AbstractMap.this.clear();} @Override public boolean isEmpty() {return AbstractMap.this.isEmpty();}
/** Returns an iterator compliant to the Map contract. */ @Override public Iterator<Entry<K,V>> iterator() { final EntryIterator<K,V> it = entryIterator(); return (it != null) ? new Entries<>(it) : Collections.<Entry<K,V>>emptyIterator(); }
/** * Removes all entries in this map. * The default operation throws {@link UnsupportedOperationException}. */ @Override public void clear() throws UnsupportedOperationException { throw new UnsupportedOperationException(message(false)); }
@Override public boolean isEmpty() {return AbstractMap.this.isEmpty();} @Override public int size() {return AbstractMap.this.size();}
/** * Returns {@code true} if this map contains a value for the given name. * The default implementation assumes that the map can not contain {@code null} values. * * @param key the key for which to test the presence of a value. * @return {@code true} if the map contains a non-null value for the given key. */ @Override public boolean containsKey(final Object key) { return get(key) != null; }
/** * Puts all entries of the given map in this map. * * @param map the other map from which to copy the entries. */ @Override public void putAll(final Map<? extends K, ? extends V> map) throws UnsupportedOperationException { for (final Entry<? extends K, ? extends V> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } }
@Override public boolean contains(Object e) {return AbstractMap.this.containsValue(e);} @Override public boolean add(V e) {return AbstractMap.this.addValue(e);}
@Override public boolean contains(Object e) {return AbstractMap.this.containsKey(e);} @Override public boolean remove(Object e) {return AbstractMap.this.remove(e) != null;}
/** * Returns {@code true} if this map contains no element. * * @return {@code true} if this map contains no element. */ @Override public boolean isEmpty() { return !entryIterator().next(); }
/** * Removes the entry at the current iterator position (optional operation). * The default implementation throws {@code UnsupportedOperationException}. */ protected void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException(message(false)); } }
@Override public boolean isEmpty() {return AbstractMap.this.isEmpty();} @Override public int size() {return AbstractMap.this.size();}
/** * Returns {@code true} if this map contains a value for the given name. * The default implementation assumes that the map can not contain {@code null} values. * * @param key the key for which to test the presence of a value. * @return {@code true} if the map contains a non-null value for the given key. */ @Override public boolean containsKey(final Object key) { return get(key) != null; }
/** * Puts all entries of the given map in this map. * * @param map the other map from which to copy the entries. */ @Override public void putAll(final Map<? extends K, ? extends V> map) throws UnsupportedOperationException { for (final Entry<? extends K, ? extends V> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } }
@Override public boolean contains(Object e) {return AbstractMap.this.containsValue(e);} @Override public boolean add(V e) {return AbstractMap.this.addValue(e);}
@Override public boolean contains(Object e) {return AbstractMap.this.containsKey(e);} @Override public boolean remove(Object e) {return AbstractMap.this.remove(e) != null;}
@Override public Iterator<V> iterator() { final EntryIterator<K,V> it = entryIterator(); return (it != null) ? new Values<>(it) : Collections.<V>emptyIterator(); } };
/** * Removes the entry for the given key in this map. * The default operation throws {@link UnsupportedOperationException}. * * @param key the key of the entry to remove. * @return the previous value, or {@code null} if none. */ @Override public V remove(Object key) throws UnsupportedOperationException { throw new UnsupportedOperationException(message(false)); }
@Override public void clear() { AbstractMap.this.clear();} @Override public boolean isEmpty() {return AbstractMap.this.isEmpty();}