88 lines
2.8 KiB
Java
88 lines
2.8 KiB
Java
package com.google.common.collect;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class ImmutableMapValues<K, V> extends ImmutableCollection<V> {
|
|
private final ImmutableMap<K, V> a;
|
|
|
|
private static class SerializedForm<V> implements Serializable {
|
|
final ImmutableMap<?, V> a;
|
|
|
|
SerializedForm(ImmutableMap<?, V> immutableMap) {
|
|
this.a = immutableMap;
|
|
}
|
|
|
|
Object readResolve() {
|
|
return this.a.values();
|
|
}
|
|
}
|
|
|
|
ImmutableMapValues(ImmutableMap<K, V> immutableMap) {
|
|
this.a = immutableMap;
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection
|
|
public ImmutableList<V> asList() {
|
|
final ImmutableList<Map.Entry<K, V>> asList = this.a.entrySet().asList();
|
|
return new ImmutableList<V>(this) { // from class: com.google.common.collect.ImmutableMapValues.2
|
|
@Override // java.util.List
|
|
public V get(int i) {
|
|
return (V) ((Map.Entry) asList.get(i)).getValue();
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection
|
|
boolean isPartialView() {
|
|
return true;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
|
public int size() {
|
|
return asList.size();
|
|
}
|
|
};
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean contains(Object obj) {
|
|
return obj != null && Iterators.a(iterator(), obj);
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection
|
|
boolean isPartialView() {
|
|
return true;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public int size() {
|
|
return this.a.size();
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection
|
|
Object writeReplace() {
|
|
return new SerializedForm(this.a);
|
|
}
|
|
|
|
@Override // com.google.common.collect.ImmutableCollection, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set, java.util.NavigableSet
|
|
public UnmodifiableIterator<V> iterator() {
|
|
return new UnmodifiableIterator<V>() { // from class: com.google.common.collect.ImmutableMapValues.1
|
|
final UnmodifiableIterator<Map.Entry<K, V>> a;
|
|
|
|
{
|
|
this.a = ImmutableMapValues.this.a.entrySet().iterator();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.a.hasNext();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public V next() {
|
|
return this.a.next().getValue();
|
|
}
|
|
};
|
|
}
|
|
}
|