package com.google.common.graph; import com.google.common.base.Preconditions; import com.google.common.collect.AbstractIterator; import com.google.common.collect.UnmodifiableIterator; import java.util.AbstractSet; import java.util.Iterator; import java.util.Map; import javax.annotation.CheckForNull; @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ abstract class MultiEdgesConnecting extends AbstractSet { private final Map outEdgeToNode; private final Object targetNode; /* JADX INFO: Access modifiers changed from: package-private */ public MultiEdgesConnecting(Map map, Object obj) { this.outEdgeToNode = (Map) Preconditions.checkNotNull(map); this.targetNode = Preconditions.checkNotNull(obj); } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public UnmodifiableIterator iterator() { final Iterator> it = this.outEdgeToNode.entrySet().iterator(); return new AbstractIterator() { // from class: com.google.common.graph.MultiEdgesConnecting.1 @Override // com.google.common.collect.AbstractIterator @CheckForNull protected E computeNext() { while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); if (MultiEdgesConnecting.this.targetNode.equals(entry.getValue())) { return (E) entry.getKey(); } } return endOfData(); } }; } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public boolean contains(@CheckForNull Object obj) { return this.targetNode.equals(this.outEdgeToNode.get(obj)); } }