Class GraphStreamWrapper

  • Direct Known Subclasses:
    DotGraph, GraphmlGraph, HtmlGraph

    public abstract class GraphStreamWrapper
    extends java.lang.Object
    A graph instance that decorates a graphstream Graph, offering custom/improved dumping.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.graphstream.graph.Graph graph
      The wrapped graph.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GraphStreamWrapper()
      Builds the wrapper.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void dump​(java.io.Writer writer)
      Dumps this graph through the given Writer.
      protected static java.lang.String edgeName​(long src, long dest)
      Given the codes for the source and destination edges, builds the name of an edge that can be added to, removed from or retrieved from the wrapped graph.
      protected static java.lang.String nodeName​(long code)
      Given a code, builds the name of a node that can be added to, removed from or retrieved from the wrapped graph.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • graph

        public final org.graphstream.graph.Graph graph
        The wrapped graph.
    • Constructor Detail

      • GraphStreamWrapper

        protected GraphStreamWrapper()
        Builds the wrapper.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • nodeName

        protected static java.lang.String nodeName​(long code)
        Given a code, builds the name of a node that can be added to, removed from or retrieved from the wrapped graph.
        Parameters:
        code - the code
        Returns:
        the name of the node
      • edgeName

        protected static java.lang.String edgeName​(long src,
                                                   long dest)
        Given the codes for the source and destination edges, builds the name of an edge that can be added to, removed from or retrieved from the wrapped graph.
        Parameters:
        src - the code of the source node
        dest - the code of the destination node
        Returns:
        the name of the edge
      • dump

        public abstract void dump​(java.io.Writer writer)
                           throws java.io.IOException
        Dumps this graph through the given Writer.
        Parameters:
        writer - the writer to use for dumping the graph
        Throws:
        java.io.IOException - if an I/O error occurs while writing