Package it.unive.lisa.outputs
Class GraphStreamWrapper
- java.lang.Object
-
- it.unive.lisa.outputs.GraphStreamWrapper
-
- Direct Known Subclasses:
DotGraph
,GraphmlGraph
,HtmlGraph
public abstract class GraphStreamWrapper extends java.lang.Object
A graph instance that decorates a graphstreamGraph
, 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 givenWriter
.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()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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 nodedest
- 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 givenWriter
.- Parameters:
writer
- the writer to use for dumping the graph- Throws:
java.io.IOException
- if an I/O error occurs while writing
-
-