001 /*
002 * Copyright (C) 2010 The Guava Authors
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package com.google.common.collect;
018
019 import com.google.common.annotations.GwtCompatible;
020
021 import java.util.Map.Entry;
022 import java.util.Set;
023
024 import javax.annotation.Nullable;
025
026 /**
027 * A set multimap which forwards all its method calls to another set multimap.
028 * Subclasses should override one or more methods to modify the behavior of
029 * the backing multimap as desired per the <a
030 * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
031 *
032 * @author Kurt Alfred Kluever
033 * @since 3.0
034 */
035 @GwtCompatible
036 public abstract class ForwardingSetMultimap<K, V>
037 extends ForwardingMultimap<K, V> implements SetMultimap<K, V> {
038
039
040 @Override
041 protected abstract SetMultimap<K, V> delegate();
042
043
044 @Override
045 public Set<Entry<K, V>> entries() {
046 return delegate().entries();
047 }
048
049
050 @Override
051 public Set<V> get(@Nullable K key) {
052 return delegate().get(key);
053 }
054
055
056 @Override
057 public Set<V> removeAll(@Nullable Object key) {
058 return delegate().removeAll(key);
059 }
060
061
062 @Override
063 public Set<V> replaceValues(K key, Iterable<? extends V> values) {
064 return delegate().replaceValues(key, values);
065 }
066 }