Rabbit-R1/switch port/java/sources/com/google/common/collect/ImmutableMapKeySet.java
2024-05-21 17:08:36 -04:00

61 lines
2.2 KiB
Java

package com.google.common.collect;
import java.io.Serializable;
import javax.annotation.CheckForNull;
/* JADX INFO: Access modifiers changed from: package-private */
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.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 boolean isPartialView() {
return true;
}
/* 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 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 UnmodifiableIterator<K> iterator() {
return this.map.keyIterator();
}
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
public boolean contains(@CheckForNull Object obj) {
return this.map.containsKey(obj);
}
@Override // com.google.common.collect.IndexedImmutableSet
K get(int i) {
return this.map.entrySet().asList().get(i).getKey();
}
@Override // com.google.common.collect.ImmutableSet, com.google.common.collect.ImmutableCollection
Object writeReplace() {
return new KeySetSerializedForm(this.map);
}
/* loaded from: classes3.dex */
private 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();
}
}
}