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

66 lines
2.6 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.common.collect;
import java.io.Serializable;
import java.util.Iterator;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class ImmutableMapKeySet<K, V> extends IndexedImmutableSet<K> {
private final ImmutableMap<K, V> map;
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.ImmutableCollection
public final boolean isPartialView() {
return true;
}
@Override // com.google.common.collect.IndexedImmutableSet, 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();
}
/* JADX INFO: Access modifiers changed from: package-private */
public ImmutableMapKeySet(ImmutableMap<K, V> immutableMap) {
this.map = immutableMap;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
public final int size() {
return this.map.size();
}
@Override // com.google.common.collect.IndexedImmutableSet, 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<K> iterator() {
return this.map.keyIterator();
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
public final boolean contains(Object obj) {
return this.map.containsKey(obj);
}
@Override // com.google.common.collect.IndexedImmutableSet
final K get(int i) {
return this.map.entrySet().asList().get(i).getKey();
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
final Object writeReplace() {
return new KeySetSerializedForm(this.map);
}
/* loaded from: classes2.dex */
static class KeySetSerializedForm<K> implements Serializable {
private static final long serialVersionUID = 0;
final ImmutableMap<K, ?> map;
KeySetSerializedForm(ImmutableMap<K, ?> immutableMap) {
this.map = immutableMap;
}
Object readResolve() {
return this.map.keySet();
}
}
}