package com.google.common.graph; import com.google.common.base.Preconditions; import java.util.Collections; import java.util.Map; import java.util.Set; /* loaded from: classes2.dex */ abstract class AbstractUndirectedNetworkConnections implements NetworkConnections { protected final Map incidentEdgeMap; /* JADX INFO: Access modifiers changed from: protected */ 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) Preconditions.checkNotNull(this.incidentEdgeMap.get(e)); } @Override // com.google.common.graph.NetworkConnections 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) Preconditions.checkNotNull(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); } }