diff options
Diffstat (limited to 'guava/src/com/google/common/collect/SingletonImmutableTable.java')
-rw-r--r-- | guava/src/com/google/common/collect/SingletonImmutableTable.java | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/guava/src/com/google/common/collect/SingletonImmutableTable.java b/guava/src/com/google/common/collect/SingletonImmutableTable.java index 58a182ccc..490ece7d9 100644 --- a/guava/src/com/google/common/collect/SingletonImmutableTable.java +++ b/guava/src/com/google/common/collect/SingletonImmutableTable.java @@ -19,6 +19,7 @@ package com.google.common.collect; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.GwtCompatible; + import java.util.Map; /** @@ -42,41 +43,34 @@ class SingletonImmutableTable<R, C, V> extends ImmutableTable<R, C, V> { this(cell.getRowKey(), cell.getColumnKey(), cell.getValue()); } - @Override - public ImmutableMap<R, V> column(C columnKey) { + @Override public ImmutableMap<R, V> column(C columnKey) { checkNotNull(columnKey); return containsColumn(columnKey) ? ImmutableMap.of(singleRowKey, singleValue) : ImmutableMap.<R, V>of(); } - @Override - public ImmutableMap<C, Map<R, V>> columnMap() { - return ImmutableMap.of(singleColumnKey, (Map<R, V>) ImmutableMap.of(singleRowKey, singleValue)); + @Override public ImmutableMap<C, Map<R, V>> columnMap() { + return ImmutableMap.of(singleColumnKey, + (Map<R, V>) ImmutableMap.of(singleRowKey, singleValue)); } - @Override - public ImmutableMap<R, Map<C, V>> rowMap() { - return ImmutableMap.of(singleRowKey, (Map<C, V>) ImmutableMap.of(singleColumnKey, singleValue)); + @Override public ImmutableMap<R, Map<C, V>> rowMap() { + return ImmutableMap.of(singleRowKey, + (Map<C, V>) ImmutableMap.of(singleColumnKey, singleValue)); } - @Override - public int size() { + @Override public int size() { return 1; } @Override ImmutableSet<Cell<R, C, V>> createCellSet() { - return ImmutableSet.of(cellOf(singleRowKey, singleColumnKey, singleValue)); + return ImmutableSet.of( + cellOf(singleRowKey, singleColumnKey, singleValue)); } - @Override - ImmutableCollection<V> createValues() { + @Override ImmutableCollection<V> createValues() { return ImmutableSet.of(singleValue); } - - @Override - SerializedForm createSerializedForm() { - return SerializedForm.create(this, new int[] {0}, new int[] {0}); - } } |