what-the-bank/sources/com/google/common/collect/ImmutableMapEntrySet.java

103 lines
3.9 KiB
Java

package com.google.common.collect;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public abstract class ImmutableMapEntrySet<K, V> extends ImmutableSet<Map.Entry<K, V>> {
abstract ImmutableMap<K, V> map();
/* loaded from: classes2.dex */
static final class RegularEntrySet<K, V> extends ImmutableMapEntrySet<K, V> {
private final transient ImmutableList<Map.Entry<K, V>> entries;
private final transient ImmutableMap<K, V> map;
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet, com.google.common.collect.SortedIterable
public final /* bridge */ /* synthetic */ Iterator iterator() {
return iterator();
}
RegularEntrySet(ImmutableMap<K, V> immutableMap, Map.Entry<K, V>[] entryArr) {
this(immutableMap, ImmutableList.asImmutableList(entryArr));
}
RegularEntrySet(ImmutableMap<K, V> immutableMap, ImmutableList<Map.Entry<K, V>> immutableList) {
this.map = immutableMap;
this.entries = immutableList;
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.ImmutableCollection
public final int copyIntoArray(Object[] objArr, int i) {
return this.entries.copyIntoArray(objArr, i);
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet, com.google.common.collect.SortedIterable
public final UnmodifiableIterator<Map.Entry<K, V>> iterator() {
return this.entries.iterator();
}
@Override // com.google.common.collect.ImmutableMapEntrySet
final ImmutableMap<K, V> map() {
return this.map;
}
@Override // com.google.common.collect.ImmutableSet
final ImmutableList<Map.Entry<K, V>> createAsList() {
return this.entries;
}
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public int size() {
return map().size();
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(Object obj) {
if (!(obj instanceof Map.Entry)) {
return false;
}
Map.Entry entry = (Map.Entry) obj;
V v = map().get(entry.getKey());
return v != null && v.equals(entry.getValue());
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.ImmutableCollection
public boolean isPartialView() {
return map().isPartialView();
}
@Override // com.google.common.collect.ImmutableSet
boolean isHashCodeFast() {
return map().isHashCodeFast();
}
@Override // com.google.common.collect.ImmutableSet, java.util.Collection, java.util.Set
public int hashCode() {
return map().hashCode();
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
Object writeReplace() {
return new EntrySetSerializedForm(map());
}
/* loaded from: classes2.dex */
static class EntrySetSerializedForm<K, V> implements Serializable {
private static final long serialVersionUID = 0;
final ImmutableMap<K, V> map;
EntrySetSerializedForm(ImmutableMap<K, V> immutableMap) {
this.map = immutableMap;
}
Object readResolve() {
return this.map.entrySet();
}
}
}