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

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

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

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

@Override
public void setEdgeWeight(EndpointPair<V> e, double weight) {
    if (e == null) {
        throw new NullPointerException();
    }//from www  .j  a  va2s .c  o  m
    if (!containsEdge(e)) {
        throw new IllegalArgumentException("no such edge in graph: " + e.toString());
    }
    super.valueGraph.putEdgeValue(e.nodeU(), e.nodeV(), weight);
}

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

@Override
public double getEdgeWeight(EndpointPair<V> e) {
    if (e == null) {
        throw new NullPointerException();
    } else if (!graph.hasEdgeConnecting(e.nodeU(), e.nodeV())) {
        throw new IllegalArgumentException("no such edge in graph: " + e.toString());
    } else {//from w w w .j  a va  2s . co m
        return Graph.DEFAULT_EDGE_WEIGHT;
    }
}

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

@Override
public double getEdgeWeight(EndpointPair<V> e) {
    if (e == null) {
        throw new NullPointerException();
    } else if (!valueGraph.hasEdgeConnecting(e.nodeU(), e.nodeV())) {
        throw new IllegalArgumentException("no such edge in graph: " + e.toString());
    } else {/*from  w  ww.j av a  2 s . c om*/
        return valueGraph.edgeValue(e.nodeU(), e.nodeV()).map(valueConverter::applyAsDouble)
                .orElse(Graph.DEFAULT_EDGE_WEIGHT);
    }
}