edu.uci.ics.jung.io
Class GraphMLWriter<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.io.GraphMLWriter<V,E>

public class GraphMLWriter<V,E>
extends Object

Writes graphs out in GraphML format. Current known issues:


Field Summary
protected  boolean directed
           
protected  Map<String,GraphMLMetadata<E>> edge_data
           
protected   edge_desc
           
protected   edge_ids
           
protected  Map<String,GraphMLMetadata<Hypergraph<V,E>>> graph_data
           
protected   graph_desc
           
protected  int nest_level
           
protected  Map<String,GraphMLMetadata<V>> vertex_data
           
protected   vertex_desc
           
protected   vertex_ids
           
 
Constructor Summary
GraphMLWriter()
           
 
Method Summary
 void addEdgeData(String id, String description, String default_value,  edge_transformer)
           
 void addGraphData(String id, String description, String default_value,  graph_transformer)
           
 void addVertexData(String id, String description, String default_value,  vertex_transformer)
           
protected  String format(String type, String attr, String value, String contents)
           
 void save(Hypergraph<V,E> graph, Writer w)
           
 void setEdgeData(Map<String,GraphMLMetadata<E>> edge_map)
           
 void setEdgeDescriptions( edge_desc)
           
 void setEdgeIDs( edge_ids)
          Provides an ID that will be used to identify an edge in the output file.
 void setGraphData(Map<String,GraphMLMetadata<Hypergraph<V,E>>> graph_map)
           
 void setGraphDescriptions( graph_desc)
           
 void setVertexData(Map<String,GraphMLMetadata<V>> vertex_map)
           
 void setVertexDescriptions( vertex_desc)
           
 void setVertexIDs( vertex_ids)
          Provides an ID that will be used to identify a vertex in the output file.
protected  void writeEdgeData(Hypergraph<V,E> g, Writer w)
           
protected  void writeIndentedText(BufferedWriter w, String to_write)
           
protected  void writeKeySpecification(String key, String type, GraphMLMetadata<?> ds, BufferedWriter bw)
           
protected  void writeVertexData(Hypergraph<V,E> graph, BufferedWriter w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertex_ids

protected  vertex_ids

edge_ids

protected  edge_ids

graph_data

protected Map<String,GraphMLMetadata<Hypergraph<V,E>>> graph_data

vertex_data

protected Map<String,GraphMLMetadata<V>> vertex_data

edge_data

protected Map<String,GraphMLMetadata<E>> edge_data

vertex_desc

protected  vertex_desc

edge_desc

protected  edge_desc

graph_desc

protected  graph_desc

directed

protected boolean directed

nest_level

protected int nest_level
Constructor Detail

GraphMLWriter

public GraphMLWriter()
Method Detail

save

public void save(Hypergraph<V,E> graph,
                 Writer w)
          throws IOException
Parameters:
graph -
w -
Throws:
IOException

writeIndentedText

protected void writeIndentedText(BufferedWriter w,
                                 String to_write)
                          throws IOException
Throws:
IOException

writeVertexData

protected void writeVertexData(Hypergraph<V,E> graph,
                               BufferedWriter w)
                        throws IOException
Throws:
IOException

writeEdgeData

protected void writeEdgeData(Hypergraph<V,E> g,
                             Writer w)
                      throws IOException
Throws:
IOException

writeKeySpecification

protected void writeKeySpecification(String key,
                                     String type,
                                     GraphMLMetadata<?> ds,
                                     BufferedWriter bw)
                              throws IOException
Throws:
IOException

format

protected String format(String type,
                        String attr,
                        String value,
                        String contents)

setVertexIDs

public void setVertexIDs( vertex_ids)
Provides an ID that will be used to identify a vertex in the output file. If the vertex IDs are not set, the ID for each vertex will default to the output of toString (and thus not guaranteed to be unique).

Parameters:
vertex_ids -

setEdgeIDs

public void setEdgeIDs( edge_ids)
Provides an ID that will be used to identify an edge in the output file. If any edge ID is missing, no ID will be written out for the corresponding edge.

Parameters:
edge_ids -

setGraphData

public void setGraphData(Map<String,GraphMLMetadata<Hypergraph<V,E>>> graph_map)

setVertexData

public void setVertexData(Map<String,GraphMLMetadata<V>> vertex_map)

setEdgeData

public void setEdgeData(Map<String,GraphMLMetadata<E>> edge_map)

addGraphData

public void addGraphData(String id,
                         String description,
                         String default_value,
                          graph_transformer)

addVertexData

public void addVertexData(String id,
                          String description,
                          String default_value,
                           vertex_transformer)

addEdgeData

public void addEdgeData(String id,
                        String description,
                        String default_value,
                         edge_transformer)

setVertexDescriptions

public void setVertexDescriptions( vertex_desc)

setEdgeDescriptions

public void setEdgeDescriptions( edge_desc)

setGraphDescriptions

public void setGraphDescriptions( graph_desc)


Copyright © 2008 null. All Rights Reserved.