mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 17:12:31 -06:00
77 lines
2.2 KiB
Java
77 lines
2.2 KiB
Java
|
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<N, E> implements NetworkConnections<N, E> {
|
||
|
final Map<E, N> incidentEdgeMap;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public AbstractUndirectedNetworkConnections(Map<E, N> map) {
|
||
|
this.incidentEdgeMap = (Map) Preconditions.checkNotNull(map);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.common.graph.NetworkConnections
|
||
|
public Set<N> predecessors() {
|
||
|
return adjacentNodes();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.common.graph.NetworkConnections
|
||
|
public Set<N> successors() {
|
||
|
return adjacentNodes();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.common.graph.NetworkConnections
|
||
|
public Set<E> incidentEdges() {
|
||
|
return Collections.unmodifiableSet(this.incidentEdgeMap.keySet());
|
||
|
}
|
||
|
|
||
|
@Override // com.google.common.graph.NetworkConnections
|
||
|
public Set<E> inEdges() {
|
||
|
return incidentEdges();
|
||
|
}
|
||
|
|
||
|
@Override // com.google.common.graph.NetworkConnections
|
||
|
public Set<E> 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);
|
||
|
}
|
||
|
}
|