Example usage for com.google.common.graph EndpointPair unordered

List of usage examples for com.google.common.graph EndpointPair unordered

Introduction

In this page you can find the example usage for com.google.common.graph EndpointPair unordered.

Prototype

public static <N> EndpointPair<N> unordered(N nodeU, N nodeV) 

Source Link

Document

Returns an EndpointPair representing the endpoints of an undirected edge.

Usage

From source file:org.jgrapht.graph.guava.BaseGraphAdapter.java

/**
 * Create an edge.//from  www  .  ja v a2  s  . c  om
 * 
 * @param s the source vertex
 * @param t the target vertex
 * @return the edge
 */
final EndpointPair<V> createEdge(V s, V t) {
    return graph.isDirected() ? EndpointPair.ordered(s, t) : EndpointPair.unordered(s, t);
}

From source file:org.jgrapht.graph.guava.BaseValueGraphAdapter.java

/**
 * Create an edge//from  w  w  w  .  ja  v  a2s. com
 * 
 * @param s the source vertex
 * @param t the target vertex
 * @return the edge
 */
final EndpointPair<V> createEdge(V s, V t) {
    return valueGraph.isDirected() ? EndpointPair.ordered(s, t) : EndpointPair.unordered(s, t);
}