Coverage Summary for Class: ForwardingTable (com.google.common.collect)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| ForwardingTable | 100% (1/1) | 9.1% (2/22) | 8.3% (2/24) |
1 /* 2 * Copyright (C) 2009 The Guava Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.common.collect; 18 19 import com.google.common.annotations.GwtCompatible; 20 import com.google.errorprone.annotations.CanIgnoreReturnValue; 21 import java.util.Collection; 22 import java.util.Map; 23 import java.util.Set; 24 25 /** 26 * A table which forwards all its method calls to another table. Subclasses should override one or 27 * more methods to modify the behavior of the backing map as desired per the <a 28 * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>. 29 * 30 * @author Gregory Kick 31 * @since 7.0 32 */ 33 @GwtCompatible 34 public abstract class ForwardingTable<R, C, V> extends ForwardingObject implements Table<R, C, V> { 35 /** Constructor for use by subclasses. */ 36 protected ForwardingTable() {} 37 38 @Override 39 protected abstract Table<R, C, V> delegate(); 40 41 @Override 42 public Set<Cell<R, C, V>> cellSet() { 43 return delegate().cellSet(); 44 } 45 46 @Override 47 public void clear() { 48 delegate().clear(); 49 } 50 51 @Override 52 public Map<R, V> column(C columnKey) { 53 return delegate().column(columnKey); 54 } 55 56 @Override 57 public Set<C> columnKeySet() { 58 return delegate().columnKeySet(); 59 } 60 61 @Override 62 public Map<C, Map<R, V>> columnMap() { 63 return delegate().columnMap(); 64 } 65 66 @Override 67 public boolean contains(Object rowKey, Object columnKey) { 68 return delegate().contains(rowKey, columnKey); 69 } 70 71 @Override 72 public boolean containsColumn(Object columnKey) { 73 return delegate().containsColumn(columnKey); 74 } 75 76 @Override 77 public boolean containsRow(Object rowKey) { 78 return delegate().containsRow(rowKey); 79 } 80 81 @Override 82 public boolean containsValue(Object value) { 83 return delegate().containsValue(value); 84 } 85 86 @Override 87 public V get(Object rowKey, Object columnKey) { 88 return delegate().get(rowKey, columnKey); 89 } 90 91 @Override 92 public boolean isEmpty() { 93 return delegate().isEmpty(); 94 } 95 96 @CanIgnoreReturnValue 97 @Override 98 public V put(R rowKey, C columnKey, V value) { 99 return delegate().put(rowKey, columnKey, value); 100 } 101 102 @Override 103 public void putAll(Table<? extends R, ? extends C, ? extends V> table) { 104 delegate().putAll(table); 105 } 106 107 @CanIgnoreReturnValue 108 @Override 109 public V remove(Object rowKey, Object columnKey) { 110 return delegate().remove(rowKey, columnKey); 111 } 112 113 @Override 114 public Map<C, V> row(R rowKey) { 115 return delegate().row(rowKey); 116 } 117 118 @Override 119 public Set<R> rowKeySet() { 120 return delegate().rowKeySet(); 121 } 122 123 @Override 124 public Map<R, Map<C, V>> rowMap() { 125 return delegate().rowMap(); 126 } 127 128 @Override 129 public int size() { 130 return delegate().size(); 131 } 132 133 @Override 134 public Collection<V> values() { 135 return delegate().values(); 136 } 137 138 @Override 139 public boolean equals(Object obj) { 140 return (obj == this) || delegate().equals(obj); 141 } 142 143 @Override 144 public int hashCode() { 145 return delegate().hashCode(); 146 } 147 }