Package it.unimi.di.prog2.h24.digraph
Class DiGraphs
java.lang.Object
it.unimi.di.prog2.h24.digraph.DiGraphs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Renders a dot source to a PDF file (invoking an external command).static <T> void
fromAdjacencyMap
(Map<T, Collection<T>> adjacency, DiGraph<T> graph) Fills the given graph with the arcs described by the given adjacency map.static <T> String
Returns the dot representation of the given graph.static <T> String
Returns the dot representation of the given graph.
-
Constructor Details
-
DiGraphs
private DiGraphs().
-
-
Method Details
-
fromAdjacencyMap
Fills the given graph with the arcs described by the given adjacency map.- Type Parameters:
T
- the type of the graph nodes.- Parameters:
adjacency
- the adjacency map.graph
- the mutable graph to fill.- Throws:
NullPointerException
- ifadjacency
is or containsnull
orgraph
isnull
.UnsupportedOperationException
- ifgraph
is immutable.
-
toDot
Returns the dot representation of the given graph.- Type Parameters:
T
- the type of the graph nodes.- Parameters:
graph
- the graph.- Returns:
- the dot representation of the given graph.
- Throws:
NullPointerException
- ifgraph
isnull
.
-
toDot
Returns the dot representation of the given graph.- Type Parameters:
T
- the type of the graph nodes.- Parameters:
graph
- the graph.extra
- extra configuration to be added to the dot source, may benull
.- Returns:
- the dot representation of the given graph.
- Throws:
NullPointerException
- ifgraph
isnull
.
-
dotToPdf
Renders a dot source to a PDF file (invoking an external command).- Parameters:
dot
- the dot sourcepath
- path of the PDF to create.- Throws:
NullPointerException
- ifdot
orpath
isnull
.
-