Rabbit-R1/switch port/java/sources/com/google/common/collect/SingletonImmutableTable.java
2024-05-21 17:08:36 -04:00

73 lines
2.9 KiB
Java

package com.google.common.collect;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Table;
import java.util.Map;
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.dex */
class SingletonImmutableTable<R, C, V> extends ImmutableTable<R, C, V> {
final C singleColumnKey;
final R singleRowKey;
final V singleValue;
@Override // com.google.common.collect.Table
public int size() {
return 1;
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
public /* bridge */ /* synthetic */ Map column(Object obj) {
return column((SingletonImmutableTable<R, C, V>) obj);
}
/* JADX INFO: Access modifiers changed from: package-private */
public SingletonImmutableTable(R r, C c, V v) {
this.singleRowKey = (R) Preconditions.checkNotNull(r);
this.singleColumnKey = (C) Preconditions.checkNotNull(c);
this.singleValue = (V) Preconditions.checkNotNull(v);
}
/* JADX INFO: Access modifiers changed from: package-private */
public SingletonImmutableTable(Table.Cell<R, C, V> cell) {
this(cell.getRowKey(), cell.getColumnKey(), cell.getValue());
}
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
public ImmutableMap<R, V> column(C c) {
Preconditions.checkNotNull(c);
if (containsColumn(c)) {
return ImmutableMap.of(this.singleRowKey, (Object) this.singleValue);
}
return ImmutableMap.of();
}
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
public ImmutableMap<C, Map<R, V>> columnMap() {
return ImmutableMap.of(this.singleColumnKey, ImmutableMap.of(this.singleRowKey, (Object) this.singleValue));
}
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
public ImmutableMap<R, Map<C, V>> rowMap() {
return ImmutableMap.of(this.singleRowKey, ImmutableMap.of(this.singleColumnKey, (Object) this.singleValue));
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.AbstractTable
public ImmutableSet<Table.Cell<R, C, V>> createCellSet() {
return ImmutableSet.of(cellOf(this.singleRowKey, this.singleColumnKey, this.singleValue));
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.AbstractTable
public ImmutableCollection<V> createValues() {
return ImmutableSet.of(this.singleValue);
}
@Override // com.google.common.collect.ImmutableTable
ImmutableTable.SerializedForm createSerializedForm() {
return ImmutableTable.SerializedForm.create(this, new int[]{0}, new int[]{0});
}
}