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

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

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

Writes a topology in .net format. See NetGraphReader for more information on the .net file format.

Flating-point values are always written in "US" format (decimal point is the character '.').

Author:
Juan Segovia S.

Constructor Summary
NetGraphWriter(SimGraph<V,E> g)
          Creates a new instance that will write the topology g to System.out.
NetGraphWriter(java.lang.String fname, SimGraph<V,E> g)
          Creates a new instance that will write the topology g to a file indicated by fname.
NetGraphWriter(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.
 void writeCapacityMatrix(java.lang.String sect_name)
          Writes the capacity matrix.
 
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

NetGraphWriter

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


NetGraphWriter

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


NetGraphWriter

public NetGraphWriter(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.

Overrides:
writeAll in class SgfGraphWriter<V extends GraphIONode,E>

writeCapacityMatrix

public void writeCapacityMatrix(java.lang.String sect_name)
Writes the capacity matrix. Puts a "label" at the top to facilitate its reading.

This is public on purpose: It might be useful outside of NetGraphWriter.

Parameters:
sect_name - the section name (or any other "heading").