88 lines
2.4 KiB
Java
88 lines
2.4 KiB
Java
package com.google.common.collect;
|
|
|
|
import com.google.common.base.Function;
|
|
import com.google.common.base.Objects;
|
|
import com.google.common.collect.Table;
|
|
import java.io.Serializable;
|
|
import java.util.Collections;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class Tables {
|
|
|
|
static abstract class AbstractCell<R, C, V> implements Table.Cell<R, C, V> {
|
|
AbstractCell() {
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Table.Cell)) {
|
|
return false;
|
|
}
|
|
Table.Cell cell = (Table.Cell) obj;
|
|
return Objects.a(b(), cell.b()) && Objects.a(a(), cell.a()) && Objects.a(getValue(), cell.getValue());
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.a(b(), a(), getValue());
|
|
}
|
|
|
|
public String toString() {
|
|
return "(" + b() + "," + a() + ")=" + getValue();
|
|
}
|
|
}
|
|
|
|
static final class ImmutableCell<R, C, V> extends AbstractCell<R, C, V> implements Serializable {
|
|
private final R a;
|
|
private final C b;
|
|
private final V c;
|
|
|
|
ImmutableCell(R r, C c, V v) {
|
|
this.a = r;
|
|
this.b = c;
|
|
this.c = v;
|
|
}
|
|
|
|
@Override // com.google.common.collect.Table.Cell
|
|
public C a() {
|
|
return this.b;
|
|
}
|
|
|
|
@Override // com.google.common.collect.Table.Cell
|
|
public R b() {
|
|
return this.a;
|
|
}
|
|
|
|
@Override // com.google.common.collect.Table.Cell
|
|
public V getValue() {
|
|
return this.c;
|
|
}
|
|
}
|
|
|
|
static {
|
|
new Function<Map<Object, Object>, Map<Object, Object>>() { // from class: com.google.common.collect.Tables.1
|
|
@Override // com.google.common.base.Function
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public Map<Object, Object> apply(Map<Object, Object> map) {
|
|
return Collections.unmodifiableMap(map);
|
|
}
|
|
};
|
|
}
|
|
|
|
public static <R, C, V> Table.Cell<R, C, V> a(R r, C c, V v) {
|
|
return new ImmutableCell(r, c, v);
|
|
}
|
|
|
|
static boolean a(Table<?, ?, ?> table, Object obj) {
|
|
if (obj == table) {
|
|
return true;
|
|
}
|
|
if (obj instanceof Table) {
|
|
return table.cellSet().equals(((Table) obj).cellSet());
|
|
}
|
|
return false;
|
|
}
|
|
}
|