Class ImmutableValueGraph<N,​V>

    • Constructor Detail

      • ImmutableValueGraph

        private ImmutableValueGraph​(ValueGraph<N,​V> graph)
    • Method Detail

      • edgeValue

        public V edgeValue​(java.lang.Object nodeU,
                           java.lang.Object nodeV)
        Description copied from interface: ValueGraph
        If there is an edge connecting nodeU to nodeV, returns the non-null value associated with that edge.

        In an undirected graph, this is equal to edgeValue(nodeV, nodeU).

        Specified by:
        edgeValue in interface ValueGraph<N,​V>
      • edgeValueOrDefault

        public V edgeValueOrDefault​(java.lang.Object nodeU,
                                    java.lang.Object nodeV,
                                    @Nullable
                                    V defaultValue)
        Description copied from interface: ValueGraph
        If there is an edge connecting nodeU to nodeV, returns the non-null value associated with that edge; otherwise, returns defaultValue.

        In an undirected graph, this is equal to edgeValueOrDefault(nodeV, nodeU, defaultValue).

        Specified by:
        edgeValueOrDefault in interface ValueGraph<N,​V>
      • toString

        public java.lang.String toString()
        Description copied from class: AbstractGraph
        Returns a string representation of this graph.
        Overrides:
        toString in class AbstractGraph<N>