org.graphstream.graph.implementations
Class Graphs

java.lang.Object
  extended by org.graphstream.graph.implementations.Graphs

public class Graphs
extends Object


Constructor Summary
Graphs()
           
 
Method Summary
static Graph merge(Graph... graphs)
          Merge several graphs in one.
static void mergeIn(Graph result, Graph... graphs)
          Merge several graphs in one.
static Graph synchronizedGraph(Graph g)
          Synchronizes a graph.
static Graph unmutableGraph(Graph g)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graphs

public Graphs()
Method Detail

unmutableGraph

public static Graph unmutableGraph(Graph g)

synchronizedGraph

public static Graph synchronizedGraph(Graph g)
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

public static Graph merge(Graph... graphs)
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

public static void mergeIn(Graph result,
                           Graph... graphs)
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.


Copyright © 2012. All Rights Reserved.