83 lines
3.3 KiB
Java
83 lines
3.3 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;
|
|
|
|
/* loaded from: classes2.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);
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
|
|
public /* bridge */ /* synthetic */ Map columnMap() {
|
|
return columnMap();
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableTable, com.google.common.collect.Table
|
|
public /* bridge */ /* synthetic */ Map rowMap() {
|
|
return rowMap();
|
|
}
|
|
|
|
/* 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});
|
|
}
|
|
}
|