org.jgrapht.experimental
Class GraphReader<V,E>

java.lang.Object
  extended by org.jgrapht.experimental.GraphReader<V,E>
All Implemented Interfaces:
GraphGenerator<V,E,V>

public class GraphReader<V,E>
extends Object
implements GraphGenerator<V,E,V>


Constructor Summary
GraphReader(Reader input)
          Construct a new GraphReader.
GraphReader(Reader input, double defaultWeight)
          Construct a new GraphReader.
 
Method Summary
 void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, Map<String,V> resultMap)
          Generate a graph structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphReader

public GraphReader(Reader input)
            throws IOException
Construct a new GraphReader.

Throws:
IOException

GraphReader

public GraphReader(Reader input,
                   double defaultWeight)
            throws IOException
Construct a new GraphReader.

Throws:
IOException
Method Detail

generateGraph

public void generateGraph(Graph<V,E> target,
                          VertexFactory<V> vertexFactory,
                          Map<String,V> resultMap)
Generate a graph structure. The topology of the generated graph is dependent on the implementation. For graphs in which not all vertices share the same automorphism equivalence class, the generator may produce a labeling indicating the roles played by generated elements. This is the purpose of the resultMap parameter. For example, a generator for a wheel graph would designate a hub vertex. Role names used as keys in resultMap should be declared as public static final Strings by implementation classes.

Specified by:
generateGraph in interface GraphGenerator<V,E,V>
Parameters:
target - receives the generated edges and vertices; if this is non-empty on entry, the result will be a disconnected graph since generated elements will not be connected to existing elements
vertexFactory - called to produce new vertices
resultMap - if non-null, receives implementation-specific mappings from String roles to graph elements (or collections of graph elements)


Copyright © 2013. All rights reserved.