package com.google.common.collect; import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.base.Predicates; import com.google.common.base.Supplier; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.collect.Table; import java.io.Serializable; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import java.util.Set; import javax.annotation.CheckForNull; /* JADX INFO: Access modifiers changed from: package-private */ @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ public class StandardTable extends AbstractTable implements Serializable { private static final long serialVersionUID = 0; @GwtTransient final Map> backingMap; @CheckForNull private transient Set columnKeySet; @CheckForNull private transient StandardTable.ColumnMap columnMap; @GwtTransient final Supplier> factory; @CheckForNull private transient Map> rowMap; /* JADX INFO: Access modifiers changed from: package-private */ public StandardTable(Map> map, Supplier> supplier) { this.backingMap = map; this.factory = supplier; } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public boolean contains(@CheckForNull Object obj, @CheckForNull Object obj2) { return (obj == null || obj2 == null || !super.contains(obj, obj2)) ? false : true; } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public boolean containsColumn(@CheckForNull Object obj) { if (obj == null) { return false; } Iterator> it = this.backingMap.values().iterator(); while (it.hasNext()) { if (Maps.safeContainsKey(it.next(), obj)) { return true; } } return false; } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public boolean containsRow(@CheckForNull Object obj) { return obj != null && Maps.safeContainsKey(this.backingMap, obj); } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public boolean containsValue(@CheckForNull Object obj) { return obj != null && super.containsValue(obj); } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table @CheckForNull public V get(@CheckForNull Object obj, @CheckForNull Object obj2) { if (obj == null || obj2 == null) { return null; } return (V) super.get(obj, obj2); } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public boolean isEmpty() { return this.backingMap.isEmpty(); } @Override // com.google.common.collect.Table public int size() { Iterator> it = this.backingMap.values().iterator(); int i = 0; while (it.hasNext()) { i += it.next().size(); } return i; } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public void clear() { this.backingMap.clear(); } private Map getOrCreate(R r) { Map map = this.backingMap.get(r); if (map != null) { return map; } Map map2 = this.factory.get(); this.backingMap.put(r, map2); return map2; } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table @CheckForNull public V put(R r, C c, V v) { Preconditions.checkNotNull(r); Preconditions.checkNotNull(c); Preconditions.checkNotNull(v); return getOrCreate(r).put(c, v); } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table @CheckForNull public V remove(@CheckForNull Object obj, @CheckForNull Object obj2) { Map map; if (obj == null || obj2 == null || (map = (Map) Maps.safeGet(this.backingMap, obj)) == null) { return null; } V v = (V) map.remove(obj2); if (map.isEmpty()) { this.backingMap.remove(obj); } return v; } /* JADX INFO: Access modifiers changed from: private */ public Map removeColumn(@CheckForNull Object obj) { LinkedHashMap linkedHashMap = new LinkedHashMap(); Iterator>> it = this.backingMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry> next = it.next(); V remove = next.getValue().remove(obj); if (remove != null) { linkedHashMap.put(next.getKey(), remove); if (next.getValue().isEmpty()) { it.remove(); } } } return linkedHashMap; } /* JADX INFO: Access modifiers changed from: private */ public boolean containsMapping(@CheckForNull Object obj, @CheckForNull Object obj2, @CheckForNull Object obj3) { return obj3 != null && obj3.equals(get(obj, obj2)); } /* JADX INFO: Access modifiers changed from: private */ public boolean removeMapping(@CheckForNull Object obj, @CheckForNull Object obj2, @CheckForNull Object obj3) { if (!containsMapping(obj, obj2, obj3)) { return false; } remove(obj, obj2); return true; } /* loaded from: classes3.dex */ private abstract class TableSet extends Sets.ImprovedAbstractSet { private TableSet() { } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean isEmpty() { return StandardTable.this.backingMap.isEmpty(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public void clear() { StandardTable.this.backingMap.clear(); } } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public Set> cellSet() { return super.cellSet(); } @Override // com.google.common.collect.AbstractTable Iterator> cellIterator() { return new CellIterator(); } /* loaded from: classes3.dex */ private class CellIterator implements Iterator> { Iterator> columnIterator; @CheckForNull Map.Entry> rowEntry; final Iterator>> rowIterator; private CellIterator() { this.rowIterator = StandardTable.this.backingMap.entrySet().iterator(); this.columnIterator = Iterators.emptyModifiableIterator(); } @Override // java.util.Iterator public boolean hasNext() { return this.rowIterator.hasNext() || this.columnIterator.hasNext(); } @Override // java.util.Iterator public Table.Cell next() { if (!this.columnIterator.hasNext()) { Map.Entry> next = this.rowIterator.next(); this.rowEntry = next; this.columnIterator = next.getValue().entrySet().iterator(); } Objects.requireNonNull(this.rowEntry); Map.Entry next2 = this.columnIterator.next(); return Tables.immutableCell(this.rowEntry.getKey(), next2.getKey(), next2.getValue()); } @Override // java.util.Iterator public void remove() { this.columnIterator.remove(); if (((Map) ((Map.Entry) Objects.requireNonNull(this.rowEntry)).getValue()).isEmpty()) { this.rowIterator.remove(); this.rowEntry = null; } } } @Override // com.google.common.collect.Table public Map row(R r) { return new Row(r); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class Row extends Maps.IteratorBasedAbstractMap { @CheckForNull Map backingRowMap; final R rowKey; /* JADX INFO: Access modifiers changed from: package-private */ public Row(R r) { this.rowKey = (R) Preconditions.checkNotNull(r); } /* JADX INFO: Access modifiers changed from: package-private */ public final void updateBackingRowMapField() { Map map = this.backingRowMap; if (map == null || (map.isEmpty() && StandardTable.this.backingMap.containsKey(this.rowKey))) { this.backingRowMap = computeBackingRowMap(); } } @CheckForNull Map computeBackingRowMap() { return StandardTable.this.backingMap.get(this.rowKey); } void maintainEmptyInvariant() { updateBackingRowMapField(); Map map = this.backingRowMap; if (map == null || !map.isEmpty()) { return; } StandardTable.this.backingMap.remove(this.rowKey); this.backingRowMap = null; } @Override // java.util.AbstractMap, java.util.Map public boolean containsKey(@CheckForNull Object obj) { Map map; updateBackingRowMapField(); return (obj == null || (map = this.backingRowMap) == null || !Maps.safeContainsKey(map, obj)) ? false : true; } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V get(@CheckForNull Object obj) { Map map; updateBackingRowMapField(); if (obj == null || (map = this.backingRowMap) == null) { return null; } return (V) Maps.safeGet(map, obj); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V put(C c, V v) { Preconditions.checkNotNull(c); Preconditions.checkNotNull(v); Map map = this.backingRowMap; if (map != null && !map.isEmpty()) { return this.backingRowMap.put(c, v); } return (V) StandardTable.this.put(this.rowKey, c, v); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V remove(@CheckForNull Object obj) { updateBackingRowMapField(); Map map = this.backingRowMap; if (map == null) { return null; } V v = (V) Maps.safeRemove(map, obj); maintainEmptyInvariant(); return v; } @Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map public void clear() { updateBackingRowMapField(); Map map = this.backingRowMap; if (map != null) { map.clear(); } maintainEmptyInvariant(); } @Override // com.google.common.collect.Maps.IteratorBasedAbstractMap, java.util.AbstractMap, java.util.Map public int size() { updateBackingRowMapField(); Map map = this.backingRowMap; if (map == null) { return 0; } return map.size(); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // com.google.common.collect.Maps.IteratorBasedAbstractMap public Iterator> entryIterator() { updateBackingRowMapField(); Map map = this.backingRowMap; if (map == null) { return Iterators.emptyModifiableIterator(); } final Iterator> it = map.entrySet().iterator(); return new Iterator>() { // from class: com.google.common.collect.StandardTable.Row.1 @Override // java.util.Iterator public boolean hasNext() { return it.hasNext(); } @Override // java.util.Iterator public Map.Entry next() { return Row.this.wrapEntry((Map.Entry) it.next()); } @Override // java.util.Iterator public void remove() { it.remove(); Row.this.maintainEmptyInvariant(); } }; } Map.Entry wrapEntry(final Map.Entry entry) { return new ForwardingMapEntry(this) { // from class: com.google.common.collect.StandardTable.Row.2 /* JADX INFO: Access modifiers changed from: protected */ @Override // com.google.common.collect.ForwardingMapEntry, com.google.common.collect.ForwardingObject public Map.Entry delegate() { return entry; } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.ForwardingMapEntry, java.util.Map.Entry public V setValue(V v) { return (V) super.setValue(Preconditions.checkNotNull(v)); } @Override // com.google.common.collect.ForwardingMapEntry, java.util.Map.Entry public boolean equals(@CheckForNull Object obj) { return standardEquals(obj); } }; } } @Override // com.google.common.collect.Table public Map column(C c) { return new Column(c); } /* JADX INFO: Access modifiers changed from: private */ /* loaded from: classes3.dex */ public class Column extends Maps.ViewCachingAbstractMap { final C columnKey; Column(C c) { this.columnKey = (C) Preconditions.checkNotNull(c); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V put(R r, V v) { return (V) StandardTable.this.put(r, this.columnKey, v); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V get(@CheckForNull Object obj) { return (V) StandardTable.this.get(obj, this.columnKey); } @Override // java.util.AbstractMap, java.util.Map public boolean containsKey(@CheckForNull Object obj) { return StandardTable.this.contains(obj, this.columnKey); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public V remove(@CheckForNull Object obj) { return (V) StandardTable.this.remove(obj, this.columnKey); } boolean removeFromColumnIf(Predicate> predicate) { Iterator>> it = StandardTable.this.backingMap.entrySet().iterator(); boolean z = false; while (it.hasNext()) { Map.Entry> next = it.next(); Map value = next.getValue(); V v = value.get(this.columnKey); if (v != null && predicate.apply(Maps.immutableEntry(next.getKey(), v))) { value.remove(this.columnKey); if (value.isEmpty()) { it.remove(); } z = true; } } return z; } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap Set> createEntrySet() { return new EntrySet(); } /* loaded from: classes3.dex */ private class EntrySet extends Sets.ImprovedAbstractSet> { private EntrySet() { } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator> iterator() { return new EntrySetIterator(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { Iterator> it = StandardTable.this.backingMap.values().iterator(); int i = 0; while (it.hasNext()) { if (it.next().containsKey(Column.this.columnKey)) { i++; } } return i; } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean isEmpty() { return !StandardTable.this.containsColumn(Column.this.columnKey); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public void clear() { Column.this.removeFromColumnIf(Predicates.alwaysTrue()); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { if (!(obj instanceof Map.Entry)) { return false; } Map.Entry entry = (Map.Entry) obj; return StandardTable.this.containsMapping(entry.getKey(), Column.this.columnKey, entry.getValue()); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean remove(@CheckForNull Object obj) { if (!(obj instanceof Map.Entry)) { return false; } Map.Entry entry = (Map.Entry) obj; return StandardTable.this.removeMapping(entry.getKey(), Column.this.columnKey, entry.getValue()); } @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean retainAll(Collection collection) { return Column.this.removeFromColumnIf(Predicates.not(Predicates.in(collection))); } } /* loaded from: classes3.dex */ private class EntrySetIterator extends AbstractIterator> { final Iterator>> iterator; private EntrySetIterator() { this.iterator = StandardTable.this.backingMap.entrySet().iterator(); } /* JADX INFO: Access modifiers changed from: protected */ @Override // com.google.common.collect.AbstractIterator @CheckForNull public Map.Entry computeNext() { while (this.iterator.hasNext()) { final Map.Entry> next = this.iterator.next(); if (next.getValue().containsKey(Column.this.columnKey)) { return new AbstractMapEntry() { // from class: com.google.common.collect.StandardTable.Column.EntrySetIterator.1EntryImpl @Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry public R getKey() { return (R) next.getKey(); } @Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry public V getValue() { return (V) ((Map) next.getValue()).get(Column.this.columnKey); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry public V setValue(V v) { return (V) NullnessCasts.uncheckedCastNullableTToT(((Map) next.getValue()).put(Column.this.columnKey, Preconditions.checkNotNull(v))); } }; } } return endOfData(); } } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap Set createKeySet() { return new KeySet(); } /* loaded from: classes3.dex */ private class KeySet extends Maps.KeySet { KeySet() { super(Column.this); } @Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { return StandardTable.this.contains(obj, Column.this.columnKey); } @Override // com.google.common.collect.Maps.KeySet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean remove(@CheckForNull Object obj) { return StandardTable.this.remove(obj, Column.this.columnKey) != null; } @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean retainAll(Collection collection) { return Column.this.removeFromColumnIf(Maps.keyPredicateOnEntries(Predicates.not(Predicates.in(collection)))); } } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap Collection createValues() { return new Values(); } /* loaded from: classes3.dex */ private class Values extends Maps.Values { Values() { super(Column.this); } @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean remove(@CheckForNull Object obj) { return obj != null && Column.this.removeFromColumnIf(Maps.valuePredicateOnEntries(Predicates.equalTo(obj))); } @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean removeAll(Collection collection) { return Column.this.removeFromColumnIf(Maps.valuePredicateOnEntries(Predicates.in(collection))); } @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean retainAll(Collection collection) { return Column.this.removeFromColumnIf(Maps.valuePredicateOnEntries(Predicates.not(Predicates.in(collection)))); } } } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public Set rowKeySet() { return rowMap().keySet(); } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public Set columnKeySet() { Set set = this.columnKeySet; if (set != null) { return set; } ColumnKeySet columnKeySet = new ColumnKeySet(); this.columnKeySet = columnKeySet; return columnKeySet; } /* JADX INFO: Access modifiers changed from: private */ /* loaded from: classes3.dex */ public class ColumnKeySet extends StandardTable.TableSet { private ColumnKeySet() { super(); } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator iterator() { return StandardTable.this.createColumnKeyIterator(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { return Iterators.size(iterator()); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean remove(@CheckForNull Object obj) { boolean z = false; if (obj == null) { return false; } Iterator> it = StandardTable.this.backingMap.values().iterator(); while (it.hasNext()) { Map next = it.next(); if (next.keySet().remove(obj)) { if (next.isEmpty()) { it.remove(); } z = true; } } return z; } @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean removeAll(Collection collection) { Preconditions.checkNotNull(collection); Iterator> it = StandardTable.this.backingMap.values().iterator(); boolean z = false; while (it.hasNext()) { Map next = it.next(); if (Iterators.removeAll(next.keySet().iterator(), collection)) { if (next.isEmpty()) { it.remove(); } z = true; } } return z; } @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean retainAll(Collection collection) { Preconditions.checkNotNull(collection); Iterator> it = StandardTable.this.backingMap.values().iterator(); boolean z = false; while (it.hasNext()) { Map next = it.next(); if (next.keySet().retainAll(collection)) { if (next.isEmpty()) { it.remove(); } z = true; } } return z; } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { return StandardTable.this.containsColumn(obj); } } Iterator createColumnKeyIterator() { return new ColumnKeyIterator(); } /* JADX INFO: Access modifiers changed from: private */ /* loaded from: classes3.dex */ public class ColumnKeyIterator extends AbstractIterator { Iterator> entryIterator; final Iterator> mapIterator; final Map seen; private ColumnKeyIterator() { this.seen = StandardTable.this.factory.get(); this.mapIterator = StandardTable.this.backingMap.values().iterator(); this.entryIterator = Iterators.emptyIterator(); } @Override // com.google.common.collect.AbstractIterator @CheckForNull protected C computeNext() { while (true) { if (this.entryIterator.hasNext()) { Map.Entry next = this.entryIterator.next(); if (!this.seen.containsKey(next.getKey())) { this.seen.put(next.getKey(), next.getValue()); return next.getKey(); } } else if (this.mapIterator.hasNext()) { this.entryIterator = this.mapIterator.next().entrySet().iterator(); } else { return endOfData(); } } } } @Override // com.google.common.collect.AbstractTable, com.google.common.collect.Table public Collection values() { return super.values(); } @Override // com.google.common.collect.Table public Map> rowMap() { Map> map = this.rowMap; if (map != null) { return map; } Map> createRowMap = createRowMap(); this.rowMap = createRowMap; return createRowMap; } Map> createRowMap() { return new RowMap(); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class RowMap extends Maps.ViewCachingAbstractMap> { /* JADX INFO: Access modifiers changed from: package-private */ public RowMap() { } @Override // java.util.AbstractMap, java.util.Map public boolean containsKey(@CheckForNull Object obj) { return StandardTable.this.containsRow(obj); } /* JADX WARN: Multi-variable type inference failed */ @Override // java.util.AbstractMap, java.util.Map @CheckForNull public Map get(@CheckForNull Object obj) { if (StandardTable.this.containsRow(obj)) { return StandardTable.this.row(Objects.requireNonNull(obj)); } return null; } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public Map remove(@CheckForNull Object obj) { if (obj == null) { return null; } return StandardTable.this.backingMap.remove(obj); } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap protected Set>> createEntrySet() { return new EntrySet(); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class EntrySet extends StandardTable.TableSet>> { EntrySet() { super(); } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator>> iterator() { return Maps.asMapEntryIterator(StandardTable.this.backingMap.keySet(), new Function>() { // from class: com.google.common.collect.StandardTable.RowMap.EntrySet.1 @Override // com.google.common.base.Function public /* bridge */ /* synthetic */ Object apply(Object obj) { return apply((AnonymousClass1) obj); } @Override // com.google.common.base.Function public Map apply(R r) { return StandardTable.this.row(r); } }); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { return StandardTable.this.backingMap.size(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { if (!(obj instanceof Map.Entry)) { return false; } Map.Entry entry = (Map.Entry) obj; return entry.getKey() != null && (entry.getValue() instanceof Map) && Collections2.safeContains(StandardTable.this.backingMap.entrySet(), entry); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean remove(@CheckForNull Object obj) { if (!(obj instanceof Map.Entry)) { return false; } Map.Entry entry = (Map.Entry) obj; return entry.getKey() != null && (entry.getValue() instanceof Map) && StandardTable.this.backingMap.entrySet().remove(entry); } } } @Override // com.google.common.collect.Table public Map> columnMap() { StandardTable.ColumnMap columnMap = this.columnMap; if (columnMap != null) { return columnMap; } StandardTable.ColumnMap columnMap2 = new ColumnMap(); this.columnMap = columnMap2; return columnMap2; } /* JADX INFO: Access modifiers changed from: private */ /* loaded from: classes3.dex */ public class ColumnMap extends Maps.ViewCachingAbstractMap> { private ColumnMap() { } /* JADX WARN: Multi-variable type inference failed */ @Override // java.util.AbstractMap, java.util.Map @CheckForNull public Map get(@CheckForNull Object obj) { if (StandardTable.this.containsColumn(obj)) { return StandardTable.this.column(Objects.requireNonNull(obj)); } return null; } @Override // java.util.AbstractMap, java.util.Map public boolean containsKey(@CheckForNull Object obj) { return StandardTable.this.containsColumn(obj); } @Override // java.util.AbstractMap, java.util.Map @CheckForNull public Map remove(@CheckForNull Object obj) { if (StandardTable.this.containsColumn(obj)) { return StandardTable.this.removeColumn(obj); } return null; } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap public Set>> createEntrySet() { return new ColumnMapEntrySet(); } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap, java.util.AbstractMap, java.util.Map public Set keySet() { return StandardTable.this.columnKeySet(); } @Override // com.google.common.collect.Maps.ViewCachingAbstractMap Collection> createValues() { return new ColumnMapValues(); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class ColumnMapEntrySet extends StandardTable.TableSet>> { ColumnMapEntrySet() { super(); } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator>> iterator() { return Maps.asMapEntryIterator(StandardTable.this.columnKeySet(), new Function>() { // from class: com.google.common.collect.StandardTable.ColumnMap.ColumnMapEntrySet.1 @Override // com.google.common.base.Function public /* bridge */ /* synthetic */ Object apply(Object obj) { return apply((AnonymousClass1) obj); } @Override // com.google.common.base.Function public Map apply(C c) { return StandardTable.this.column(c); } }); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { return StandardTable.this.columnKeySet().size(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { if (!(obj instanceof Map.Entry)) { return false; } Map.Entry entry = (Map.Entry) obj; if (StandardTable.this.containsColumn(entry.getKey())) { return ((Map) Objects.requireNonNull(ColumnMap.this.get(entry.getKey()))).equals(entry.getValue()); } return false; } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean remove(@CheckForNull Object obj) { if (!contains(obj) || !(obj instanceof Map.Entry)) { return false; } StandardTable.this.removeColumn(((Map.Entry) obj).getKey()); return true; } @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean removeAll(Collection collection) { Preconditions.checkNotNull(collection); return Sets.removeAllImpl(this, collection.iterator()); } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.Sets.ImprovedAbstractSet, java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean retainAll(Collection collection) { Preconditions.checkNotNull(collection); Iterator it = Lists.newArrayList(StandardTable.this.columnKeySet().iterator()).iterator(); boolean z = false; while (it.hasNext()) { Object next = it.next(); if (!collection.contains(Maps.immutableEntry(next, StandardTable.this.column(next)))) { StandardTable.this.removeColumn(next); z = true; } } return z; } } /* loaded from: classes3.dex */ private class ColumnMapValues extends Maps.Values> { ColumnMapValues() { super(ColumnMap.this); } @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean remove(@CheckForNull Object obj) { for (Map.Entry> entry : ColumnMap.this.entrySet()) { if (entry.getValue().equals(obj)) { StandardTable.this.removeColumn(entry.getKey()); return true; } } return false; } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean removeAll(Collection collection) { Preconditions.checkNotNull(collection); Iterator it = Lists.newArrayList(StandardTable.this.columnKeySet().iterator()).iterator(); boolean z = false; while (it.hasNext()) { Object next = it.next(); if (collection.contains(StandardTable.this.column(next))) { StandardTable.this.removeColumn(next); z = true; } } return z; } /* JADX WARN: Multi-variable type inference failed */ @Override // com.google.common.collect.Maps.Values, java.util.AbstractCollection, java.util.Collection public boolean retainAll(Collection collection) { Preconditions.checkNotNull(collection); Iterator it = Lists.newArrayList(StandardTable.this.columnKeySet().iterator()).iterator(); boolean z = false; while (it.hasNext()) { Object next = it.next(); if (!collection.contains(StandardTable.this.column(next))) { StandardTable.this.removeColumn(next); z = true; } } return z; } } } }