public class Graphs
extends java.lang.Object
GraphDecorator
. Currently these
wrapper types include "synchronized" and "unmodifiable".
The methods of this class may each throw a NullPointerException
if the graphs or class objects provided to them are null.
Constructor and Description |
---|
Graphs() |
Modifier and Type | Method and Description |
---|---|
static <V,E> DirectedGraph<V,E> |
synchronizedDirectedGraph(DirectedGraph<V,E> graph)
Returns a synchronized DirectedGraph backed by the passed DirectedGraph.
|
static <V,E> edu.uci.ics.jung.graph.util.Graphs.SynchronizedForest<V,E> |
synchronizedForest(Forest<V,E> forest)
Returns a synchronized Forest backed by the passed Forest.
|
static <V,E> Graph<V,E> |
synchronizedGraph(Graph<V,E> graph)
Returns a synchronized graph backed by the passed argument graph.
|
static <V,E> edu.uci.ics.jung.graph.util.Graphs.SynchronizedTree<V,E> |
synchronizedTree(Tree<V,E> tree)
Returns a synchronized Tree backed by the passed Tree.
|
static <V,E> UndirectedGraph<V,E> |
synchronizedUndirectedGraph(UndirectedGraph<V,E> graph)
Returns a synchronized UndirectedGraph backed by the passed UndirectedGraph.
|
static <V,E> DirectedGraph<V,E> |
unmodifiableDirectedGraph(DirectedGraph<V,E> graph)
Returns an unmodifiable
DirectedGraph backed by the passed graph. |
static <V,E> edu.uci.ics.jung.graph.util.Graphs.UnmodifiableForest<V,E> |
unmodifiableForest(Forest<V,E> forest)
Returns an unmodifiable
Forest backed by the passed forest. |
static <V,E> Graph<V,E> |
unmodifiableGraph(Graph<V,E> graph)
Returns an unmodifiable Graph backed by the passed Graph.
|
static <V,E> edu.uci.ics.jung.graph.util.Graphs.UnmodifiableTree<V,E> |
unmodifiableTree(Tree<V,E> tree)
Returns an unmodifiable
Tree backed by the passed tree. |
static <V,E> UndirectedGraph<V,E> |
unmodifiableUndirectedGraph(UndirectedGraph<V,E> graph)
Returns an unmodifiable
UndirectedGraph backed by the passed graph. |
public static <V,E> Graph<V,E> synchronizedGraph(Graph<V,E> graph)
V
- the vertex typeE
- the edge typegraph
- the graph for which a synchronized wrapper is to be createdpublic static <V,E> DirectedGraph<V,E> synchronizedDirectedGraph(DirectedGraph<V,E> graph)
V
- the vertex typeE
- the edge typegraph
- the graph for which a synchronized wrapper is to be createdpublic static <V,E> UndirectedGraph<V,E> synchronizedUndirectedGraph(UndirectedGraph<V,E> graph)
V
- the vertex typeE
- the edge typegraph
- the graph for which a synchronized wrapper is to be createdpublic static <V,E> edu.uci.ics.jung.graph.util.Graphs.SynchronizedForest<V,E> synchronizedForest(Forest<V,E> forest)
V
- the vertex typeE
- the edge typeforest
- the forest for which a synchronized wrapper is to be createdpublic static <V,E> edu.uci.ics.jung.graph.util.Graphs.SynchronizedTree<V,E> synchronizedTree(Tree<V,E> tree)
V
- the vertex typeE
- the edge typetree
- the tree for which a synchronized wrapper is to be createdpublic static <V,E> Graph<V,E> unmodifiableGraph(Graph<V,E> graph)
V
- the vertex typeE
- the edge typegraph
- the graph for which the unmodifiable wrapper is to be returnedpublic static <V,E> DirectedGraph<V,E> unmodifiableDirectedGraph(DirectedGraph<V,E> graph)
DirectedGraph
backed by the passed graph.V
- the vertex typeE
- the edge typegraph
- the graph for which the unmodifiable wrapper is to be returnedDirectedGraph
backed by the passed graphpublic static <V,E> UndirectedGraph<V,E> unmodifiableUndirectedGraph(UndirectedGraph<V,E> graph)
UndirectedGraph
backed by the passed graph.V
- the vertex typeE
- the edge typegraph
- the graph for which the unmodifiable wrapper is to be returnedUndirectedGraph
backed by the passed graphpublic static <V,E> edu.uci.ics.jung.graph.util.Graphs.UnmodifiableTree<V,E> unmodifiableTree(Tree<V,E> tree)
Tree
backed by the passed tree.V
- the vertex typeE
- the edge typetree
- the tree for which the unmodifiable wrapper is to be returnedTree
backed by the passed treepublic static <V,E> edu.uci.ics.jung.graph.util.Graphs.UnmodifiableForest<V,E> unmodifiableForest(Forest<V,E> forest)
Forest
backed by the passed forest.V
- the vertex typeE
- the edge typeforest
- the forest for which the unmodifiable wrapper is to be returnedForest
backed by the passed forestCopyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence