Class Graphs
java.lang.Object
org.graphstream.graph.implementations.Graphs
public class Graphs extends Object
-
Constructor Summary
Constructors Constructor Description Graphs() -
Method Summary
Modifier and Type Method Description static Graphclone(Graph g)Clone a given graph with same node/edge structure and same attributes.static voidcopyAttributes(Element source, Element target)static Graphmerge(Graph... graphs)Merge several graphs in one.static voidmergeIn(Graph result, Graph... graphs)Merge several graphs in one.static GraphsynchronizedGraph(Graph g)Synchronizes a graph.static GraphunmutableGraph(Graph g)
-
Constructor Details
-
Graphs
public Graphs()
-
-
Method Details
-
unmutableGraph
-
synchronizedGraph
Synchronizes a graph. The returned graph can be accessed and modified by several threads. You lose genericity in methods returning edge or node because each element (graph, nodes and edges) is wrapped into a synchronized wrapper which breaks original elements class.- Parameters:
g- the graph to synchronize- Returns:
- a synchronized wrapper for g
-
merge
Merge several graphs in one. A new graph is created, that will contain the result. The method will try to create a graph of the same class that the first graph to merge (it needs to have a constructor with a String). Else, a MultiGraph is used.- Parameters:
graphs- graphs to merge- Returns:
- merge result
-
mergeIn
Merge several graphs in one. The first parameter is the graph in which the other graphs will be merged.- Parameters:
result- destination graph.graphs- all graphs that will be merged in result.
-
clone
Clone a given graph with same node/edge structure and same attributes.- Parameters:
g- the graph to clone- Returns:
- a copy of g
-
copyAttributes
- Parameters:
source-target-
-