package com.google.common.graph; import com.google.common.base.Preconditions; import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.Set; import javax.annotation.CheckForNull; @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ abstract class AbstractUndirectedNetworkConnections implements NetworkConnections { final Map incidentEdgeMap; /* JADX INFO: Access modifiers changed from: package-private */ public AbstractUndirectedNetworkConnections(Map map) { this.incidentEdgeMap = (Map) Preconditions.checkNotNull(map); } @Override // com.google.common.graph.NetworkConnections public Set predecessors() { return adjacentNodes(); } @Override // com.google.common.graph.NetworkConnections public Set successors() { return adjacentNodes(); } @Override // com.google.common.graph.NetworkConnections public Set incidentEdges() { return Collections.unmodifiableSet(this.incidentEdgeMap.keySet()); } @Override // com.google.common.graph.NetworkConnections public Set inEdges() { return incidentEdges(); } @Override // com.google.common.graph.NetworkConnections public Set outEdges() { return incidentEdges(); } @Override // com.google.common.graph.NetworkConnections public N adjacentNode(E e) { return (N) Objects.requireNonNull(this.incidentEdgeMap.get(e)); } @Override // com.google.common.graph.NetworkConnections @CheckForNull public N removeInEdge(E e, boolean z) { if (z) { return null; } return removeOutEdge(e); } @Override // com.google.common.graph.NetworkConnections public N removeOutEdge(E e) { return (N) Objects.requireNonNull(this.incidentEdgeMap.remove(e)); } @Override // com.google.common.graph.NetworkConnections public void addInEdge(E e, N n, boolean z) { if (z) { return; } addOutEdge(e, n); } @Override // com.google.common.graph.NetworkConnections public void addOutEdge(E e, N n) { Preconditions.checkState(this.incidentEdgeMap.put(e, n) == null); } }