jimu-decompiled/sources/com/google/common/collect/WellBehavedMap.java
2025-05-13 19:24:51 +02:00

79 lines
2.9 KiB
Java

package com.google.common.collect;
import com.google.common.collect.Maps;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/* loaded from: classes.dex */
final class WellBehavedMap<K, V> extends ForwardingMap<K, V> {
private final Map<K, V> a;
private Set<Map.Entry<K, V>> b;
private final class EntrySet extends Maps.EntrySet<K, V> {
private EntrySet() {
}
@Override // com.google.common.collect.Maps.EntrySet
Map<K, V> c() {
return WellBehavedMap.this;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
public Iterator<Map.Entry<K, V>> iterator() {
return new TransformedIterator<K, Map.Entry<K, V>>(WellBehavedMap.this.keySet().iterator()) { // from class: com.google.common.collect.WellBehavedMap.EntrySet.1
@Override // com.google.common.collect.TransformedIterator
/* bridge */ /* synthetic */ Object a(Object obj) {
return a((AnonymousClass1) obj);
}
@Override // com.google.common.collect.TransformedIterator
Map.Entry<K, V> a(final K k) {
return new AbstractMapEntry<K, V>() { // from class: com.google.common.collect.WellBehavedMap.EntrySet.1.1
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
public K getKey() {
return (K) k;
}
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
public V getValue() {
return WellBehavedMap.this.get(k);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractMapEntry, java.util.Map.Entry
public V setValue(V v) {
return (V) WellBehavedMap.this.put(k, v);
}
};
}
};
}
}
private WellBehavedMap(Map<K, V> map) {
this.a = map;
}
static <K, V> WellBehavedMap<K, V> a(Map<K, V> map) {
return new WellBehavedMap<>(map);
}
@Override // com.google.common.collect.ForwardingMap, java.util.Map
public Set<Map.Entry<K, V>> entrySet() {
Set<Map.Entry<K, V>> set = this.b;
if (set != null) {
return set;
}
EntrySet entrySet = new EntrySet();
this.b = entrySet;
return entrySet;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.google.common.collect.ForwardingMap, com.google.common.collect.ForwardingObject
public Map<K, V> delegate() {
return this.a;
}
}