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 017package com.google.common.collect; 018 019import com.google.common.annotations.GwtCompatible; 020import java.util.Comparator; 021import java.util.SortedSet; 022import org.jspecify.annotations.Nullable; 023 024/** 025 * A sorted set multimap which forwards all its method calls to another sorted set multimap. 026 * Subclasses should override one or more methods to modify the behavior of the backing multimap as 027 * desired per the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>. 028 * 029 * <p><b>{@code default} method warning:</b> This class does <i>not</i> forward calls to {@code 030 * default} methods. Instead, it inherits their default implementations. When those implementations 031 * invoke methods, they invoke methods on the {@code ForwardingSortedSetMultimap}. 032 * 033 * @author Kurt Alfred Kluever 034 * @since 3.0 035 */ 036@GwtCompatible 037public abstract class ForwardingSortedSetMultimap< 038 K extends @Nullable Object, V extends @Nullable Object> 039 extends ForwardingSetMultimap<K, V> implements SortedSetMultimap<K, V> { 040 041 /** Constructor for use by subclasses. */ 042 protected ForwardingSortedSetMultimap() {} 043 044 @Override 045 protected abstract SortedSetMultimap<K, V> delegate(); 046 047 @Override 048 public SortedSet<V> get(@ParametricNullness K key) { 049 return delegate().get(key); 050 } 051 052 @Override 053 public SortedSet<V> removeAll(@Nullable Object key) { 054 return delegate().removeAll(key); 055 } 056 057 @Override 058 public SortedSet<V> replaceValues(@ParametricNullness K key, Iterable<? extends V> values) { 059 return delegate().replaceValues(key, values); 060 } 061 062 @Override 063 public @Nullable Comparator<? super V> valueComparator() { 064 return delegate().valueComparator(); 065 } 066}