nct.output
Class ZIPSIFWriter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>

java.lang.Object
  extended by nct.output.ZIPSIFWriter<NodeType,WeightType>

public class ZIPSIFWriter<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>>
extends java.lang.Object

This class writes the graphs contained in a given list out in SIF format to individual files contained within a ZIP archive file.


Field Summary
protected  byte[] bytes
          The bytes of the content to be written.
protected  java.lang.StringBuffer content
          The content to be written.
protected  java.util.zip.ZipOutputStream out
          The output stream.
 
Constructor Summary
ZIPSIFWriter(java.lang.String fname)
          Sets the output filename
 
Method Summary
 void add(Graph<NodeType,WeightType> graph, java.lang.String name)
          Adds graph to zip archive.
 void add(java.lang.String data, java.lang.String name)
          Adds an aribitry string to zip archive as a separate file.
 void write()
          Finishes writing the ZIP file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected java.util.zip.ZipOutputStream out
The output stream.


content

protected java.lang.StringBuffer content
The content to be written.


bytes

protected byte[] bytes
The bytes of the content to be written.

Constructor Detail

ZIPSIFWriter

public ZIPSIFWriter(java.lang.String fname)
             throws java.io.IOException
Sets the output filename

Parameters:
fname - The filename to write zip file to.
Throws:
java.io.IOException
Method Detail

add

public void add(Graph<NodeType,WeightType> graph,
                java.lang.String name)
         throws java.io.IOException
Adds graph to zip archive.

Parameters:
graph - The graph to be written as a SIF file and included in the archive.
name - The name of the SIF file to be written to the archive.
Throws:
java.io.IOException

add

public void add(java.lang.String data,
                java.lang.String name)
         throws java.io.IOException
Adds an aribitry string to zip archive as a separate file.

Parameters:
data - An arbitrary string of data that will be written as a file.
name - The name of the file to be written to the archive.
Throws:
java.io.IOException

write

public void write()
           throws java.io.IOException
Finishes writing the ZIP file. Call this after you've added the graphs you want to the archive.

Throws:
java.io.IOException