what-the-bank/sources/com/google/common/graph/UndirectedNetworkConnection...

37 lines
1.4 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;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class UndirectedNetworkConnections<N, E> extends AbstractUndirectedNetworkConnections<N, E> {
protected 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 final Set<N> adjacentNodes() {
return Collections.unmodifiableSet(((BiMap) this.incidentEdgeMap).values());
}
@Override // com.google.common.graph.NetworkConnections
public final Set<E> edgesConnecting(N n) {
return new EdgesConnecting(((BiMap) this.incidentEdgeMap).inverse(), n);
}
}