Rabbit-R1/android (non root)/java/sources/com/google/common/graph/UndirectedNetworkConnections.java
2024-05-21 17:08:36 -04:00

36 lines
1.3 KiB
Java

package com.google.common.graph;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ImmutableBiMap;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
@ElementTypesAreNonnullByDefault
/* loaded from: classes3.dex */
final class UndirectedNetworkConnections<N, E> extends AbstractUndirectedNetworkConnections<N, E> {
UndirectedNetworkConnections(Map<E, N> map) {
super(map);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static <N, E> UndirectedNetworkConnections<N, E> of() {
return new UndirectedNetworkConnections<>(HashBiMap.create(2));
}
/* JADX INFO: Access modifiers changed from: package-private */
public static <N, E> UndirectedNetworkConnections<N, E> ofImmutable(Map<E, N> map) {
return new UndirectedNetworkConnections<>(ImmutableBiMap.copyOf((Map) map));
}
@Override // com.google.common.graph.NetworkConnections
public Set<N> adjacentNodes() {
return Collections.unmodifiableSet(((BiMap) this.incidentEdgeMap).values());
}
@Override // com.google.common.graph.NetworkConnections
public Set<E> edgesConnecting(N n) {
return new EdgesConnecting(((BiMap) this.incidentEdgeMap).inverse(), n);
}
}