56 lines
1.8 KiB
Java
56 lines
1.8 KiB
Java
package com.google.common.collect;
|
|
|
|
import com.google.common.collect.ImmutableSet;
|
|
import java.io.Serializable;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class ImmutableMapKeySet<K, V> extends ImmutableSet.Indexed<K> {
|
|
private final ImmutableMap<K, V> a;
|
|
|
|
private static class KeySetSerializedForm<K> implements Serializable {
|
|
final ImmutableMap<K, ?> a;
|
|
|
|
KeySetSerializedForm(ImmutableMap<K, ?> immutableMap) {
|
|
this.a = immutableMap;
|
|
}
|
|
|
|
Object readResolve() {
|
|
return this.a.keySet();
|
|
}
|
|
}
|
|
|
|
ImmutableMapKeySet(ImmutableMap<K, V> immutableMap) {
|
|
this.a = immutableMap;
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean contains(Object obj) {
|
|
return this.a.containsKey(obj);
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableSet.Indexed
|
|
K get(int i) {
|
|
return this.a.entrySet().asList().get(i).getKey();
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection
|
|
boolean isPartialView() {
|
|
return true;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public int size() {
|
|
return this.a.size();
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
|
|
Object writeReplace() {
|
|
return new KeySetSerializedForm(this.a);
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableSet.Indexed, 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
|
|
public UnmodifiableIterator<K> iterator() {
|
|
return this.a.keyIterator();
|
|
}
|
|
}
|