Module life.expert

Class RenderGraph<N>

  • Type Parameters:
    N - the type parameter

    public final class RenderGraph<N>
    extends java.lang.Object
    The class allows you to mark some vertices or edges of the graph when outputting to a .dot file Builder pattern.
    
     MutableGraph<String> g = GraphBuilder.undirected()
     .build();
     g.putEdge( "A" , "B" );
     g.putEdge( "A" , "C" );
     g.putEdge( "B" , "C" );
     g.addNode( "D" );
    
    
     RenderGraph.graph( g )
     .log()
     .markNode( "B" , "fillcolor=red" )
     .markEdge( "B" , "C" , "color=red width=5" )
     .renderToFile(false);
     ****
    Every constructor/fabric can raise the exceptions: throws NullPointerException if argument nullable throws IllegalArgumentException if argument empty
    • Method Summary

      Modifier and Type Method Description
      RenderGraph<N> buildToFile()
      Render to file render graph.
      RenderGraph<N> buildToFile​(java.lang.String fileName)
      Render to file render graph.
      RenderGraph<N> buildToLog()
      Log render graph.
      java.lang.String buildToString()
      Render to string string.
      RenderGraph<N> clearMarkEdges()
      Clear mark edges render graph.
      RenderGraph<N> clearMarkNodes()
      Clear mark nodes render graph.
      static void deleteRenderedGraphFolder()
      Delete rendered graph folder.
      static <V> RenderGraph<V> graph​(@NonNull com.google.common.graph.Graph<V> graph)
      Graph render graph.
      static <V,​E>
      RenderGraph<V>
      graph​(@NonNull com.google.common.graph.Network<V,​E> graph)
      Graph render graph.
      static <V,​I>
      RenderGraph<V>
      graph​(@NonNull com.google.common.graph.ValueGraph<V,​I> graph)
      Graph render graph.
      RenderGraph<N> markEdge​(@NonNull com.google.common.graph.EndpointPair<N> edge, @NonNull java.lang.String property)
      Mark edge render graph.
      RenderGraph<N> markEdge​(N nodeU, N nodeV, @NonNull java.lang.String property)
      Mark edge render graph.
      RenderGraph<N> markEdges​(@NonNull java.util.Map<com.google.common.graph.EndpointPair<N>,​java.lang.String> markEdges)
      Mark edges render graph.
      RenderGraph<N> markNode​(N node, @NonNull java.lang.String property)
      Mark node render graph.
      RenderGraph<N> markNodes​(@NonNull java.util.Map<N,​java.lang.String> markNodes)
      Mark nodes render graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • graph

        public static <V> RenderGraph<V> graph​(@NonNull
                                               @NonNull com.google.common.graph.Graph<V> graph)
        Graph render graph.
        Type Parameters:
        V - the type parameter
        Parameters:
        graph - the graph
        Returns:
        the render graph
      • graph

        public static <V,​E> RenderGraph<V> graph​(@NonNull
                                                       @NonNull com.google.common.graph.Network<V,​E> graph)
        Graph render graph.
        Type Parameters:
        V - the type parameter
        E - the type parameter
        Parameters:
        graph - the graph
        Returns:
        the render graph
      • graph

        public static <V,​I> RenderGraph<V> graph​(@NonNull
                                                       @NonNull com.google.common.graph.ValueGraph<V,​I> graph)
        Graph render graph.
        Type Parameters:
        V - the type parameter
        I - the type parameter
        Parameters:
        graph - the graph
        Returns:
        the render graph
      • deleteRenderedGraphFolder

        public static void deleteRenderedGraphFolder()
        Delete rendered graph folder.
      • markNode

        public RenderGraph<N> markNode​(@NonNull
                                       N node,
                                       @NonNull
                                       @NonNull java.lang.String property)
        Mark node render graph.
        Parameters:
        node - the node
        property - the property
        Returns:
        the render graph
      • markNodes

        public RenderGraph<N> markNodes​(@NonNull
                                        @NonNull java.util.Map<N,​java.lang.String> markNodes)
        Mark nodes render graph.
        Parameters:
        markNodes - the mark nodes
        Returns:
        the render graph
      • clearMarkNodes

        public RenderGraph<N> clearMarkNodes()
        Clear mark nodes render graph.
        Returns:
        the render graph
      • markEdge

        public RenderGraph<N> markEdge​(@NonNull
                                       @NonNull com.google.common.graph.EndpointPair<N> edge,
                                       @NonNull
                                       @NonNull java.lang.String property)
        Mark edge render graph.
        Parameters:
        edge - the edge
        property - the property
        Returns:
        the render graph
      • markEdge

        public RenderGraph<N> markEdge​(@NonNull
                                       N nodeU,
                                       @NonNull
                                       N nodeV,
                                       @NonNull
                                       @NonNull java.lang.String property)
        Mark edge render graph.
        Parameters:
        nodeU - the node u
        nodeV - the node v
        property - the property
        Returns:
        the render graph
      • markEdges

        public RenderGraph<N> markEdges​(@NonNull
                                        @NonNull java.util.Map<com.google.common.graph.EndpointPair<N>,​java.lang.String> markEdges)
        Mark edges render graph.
        Parameters:
        markEdges - the mark edges
        Returns:
        the render graph
      • clearMarkEdges

        public RenderGraph<N> clearMarkEdges()
        Clear mark edges render graph.
        Returns:
        the render graph
      • buildToLog

        public RenderGraph<N> buildToLog()
        Log render graph.
        Returns:
        the render graph
      • buildToString

        public java.lang.String buildToString()
        Render to string string.
        Returns:
        the string
      • buildToFile

        public RenderGraph<N> buildToFile​(java.lang.String fileName)
        Render to file render graph.
        Parameters:
        fileName - the file name
        Returns:
        the render graph
      • buildToFile

        public RenderGraph<N> buildToFile()
        Render to file render graph.
        Returns:
        the render graph