bcds.phison.io
Class SgfGraphWriter<V extends GraphIONode,E>

java.lang.Object
  extended by bcds.phison.io.GraphWriter<V,E>
      extended by bcds.phison.io.SgfGraphWriter<V,E>
Direct Known Subclasses:
NetGraphWriter

public class SgfGraphWriter<V extends GraphIONode,E>
extends GraphWriter<V,E>

Writes a topology in .sgf format. See SgfGraphReader for more information on the .sgf file format.

Author:
Juan Segovia S.

Constructor Summary
SgfGraphWriter(SimGraph<V,E> g)
          Creates a new instance that will write the topology g to System.out.
SgfGraphWriter(java.lang.String fname, SimGraph<V,E> g)
          Creates a new instance that will write the topology g to a file indicated by fname.
SgfGraphWriter(java.io.Writer out, SimGraph<V,E> g)
          Creates a new instance that will write the topology g to out.
 
Method Summary
 void writeAll()
          Writes the topology to the selected destination.
 
Methods inherited from class bcds.phison.io.GraphWriter
printf, setCapacityMap, setCostMap, setHeadingComment, setNetName, setTrafficMatrix, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SgfGraphWriter

public SgfGraphWriter(SimGraph<V,E> g)
Creates a new instance that will write the topology g to System.out.


SgfGraphWriter

public SgfGraphWriter(java.lang.String fname,
                      SimGraph<V,E> g)
Creates a new instance that will write the topology g to a file indicated by fname.


SgfGraphWriter

public SgfGraphWriter(java.io.Writer out,
                      SimGraph<V,E> g)
Creates a new instance that will write the topology g to out.

Method Detail

writeAll

public void writeAll()
Writes the topology to the selected destination. The sections [cost] and [traffic] are written only if their respective maps are not null.

Throws:
AnyException - with "cause" IOException if flusing the output stream fails.