Package it.unive.lisa.outputs
Class GraphmlGraph
- java.lang.Object
-
- it.unive.lisa.outputs.GraphStreamWrapper
-
- it.unive.lisa.outputs.GraphmlGraph
-
public class GraphmlGraph extends GraphStreamWrapper
A graph that can be dumped into compound GraphML format.
-
-
Field Summary
-
Fields inherited from class it.unive.lisa.outputs.GraphStreamWrapper
graph
-
-
Constructor Summary
Constructors Constructor Description GraphmlGraph(java.lang.String title)
Builds a graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdge(SerializableEdge edge)
Adds an edge to the graph.void
addNode(SerializableNode node, boolean entry, boolean exit, SerializableValue label)
Adds a node to the graph.void
dump(java.io.Writer writer)
Dumps this graph through the givenWriter
.void
dump(java.io.Writer writer, boolean format)
This method provides the actual implementation fordump(Writer)
, optionally avoiding the xml formatting (i.e.java.lang.String
getTitle()
Yields the title of the graph.void
markSubNode(SerializableNode node, SerializableNode inner)
Takes note thatinner
is a subnode ofnode
instead of a proper node of the graph.-
Methods inherited from class it.unive.lisa.outputs.GraphStreamWrapper
edgeName, nodeName, toString
-
-
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
Yields the title of the graph.- Returns:
- the title
-
addNode
public void addNode(SerializableNode node, boolean entry, boolean exit, SerializableValue label)
Adds a node to the graph. The label ofnode
will be composed by joiningnode.toString()
(Object.toString()
) withlabelGenerator.apply(node)
(Function.apply(Object)
) through a new line.- Parameters:
node
- the source nodeentry
- whether or not this edge is an entrypoint of the graphexit
- whether or not this edge is an exitpoint of the graphlabel
- the additional label that can be added to each node as a subnode
-
markSubNode
public void markSubNode(SerializableNode node, SerializableNode inner)
Takes note thatinner
is a subnode ofnode
instead of a proper node of the graph. This removesinner
from the graph, and adds a new subgraph tonode
containinginner
.- Parameters:
node
- the parent nodeinner
- the subnode
-
addEdge
public void addEdge(SerializableEdge edge)
Adds an edge to the graph.- Parameters:
edge
- the source edge
-
dump
public void dump(java.io.Writer writer) throws java.io.IOException
Description copied from class:GraphStreamWrapper
Dumps this graph through the givenWriter
.- Specified by:
dump
in classGraphStreamWrapper
- Parameters:
writer
- the writer to use for dumping the graph- Throws:
java.io.IOException
- if an I/O error occurs while writing
-
dump
public void dump(java.io.Writer writer, boolean format) throws java.io.IOException
This method provides the actual implementation fordump(Writer)
, optionally avoiding the xml formatting (i.e. new lines and indentations).- Parameters:
writer
- the writer to use for dumping the graphformat
- whether or not the output should be formatted- Throws:
java.io.IOException
- if an I/O error occurs while writing
-
-