sbrt.shell.io
Class ComoFile<K,V>

java.lang.Object
  extended by sbrt.shell.io.AbstractMapOutputFile<K,V>
      extended by sbrt.shell.io.ComoFile<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
ResultsManager<java.util.Map<? extends K,? extends V>>, MapOutputFile<K,V>, MapTextFile<K,V>, MapTextOutputFile<K,V>, OutputFile<java.util.Map<? extends K,? extends V>>, SbrtFile

public class ComoFile<K,V>
extends AbstractMapOutputFile<K,V>

This class is used to write maps to text files in a column-oriented way.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
ComoFile(java.lang.String fileName, FileFormat fileFormat, java.util.Set<? extends K> columnHeaderVariables, MapFormat<K,V> vectorFormat)
          Constructs a new column-oriented map output file from the provided arguments.
ComoFile(java.lang.String fileName, FileFormat fileFormat, java.lang.String allColumnHeaderVariables, MapFormat<K,V> vectorFormat)
          Constructs a new column-oriented vector output file from the provided arguments.
ComoFile(java.lang.String fileName, java.util.Set<? extends K> columnHeaderVariables, MapFormat<K,V> vectorFormat)
          Constructs a new text-based column-oriented map output file from the provided arguments.
 
Method Summary
 void addData(java.util.Map<? extends K,? extends V> map)
          Writes the appropriate values of the provided vector to this file.
 
Methods inherited from class sbrt.shell.io.AbstractMapOutputFile
breakPoint, close, getCanonicalName, getFilterKeys, getMapFormat, getName, getOriginalName, isClosed, writeLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sbrt.kernel.io.ResultsManager
addData
 

Constructor Detail

ComoFile

public ComoFile(java.lang.String fileName,
                FileFormat fileFormat,
                java.util.Set<? extends K> columnHeaderVariables,
                MapFormat<K,V> vectorFormat)
Constructs a new column-oriented map output file from the provided arguments.

Parameters:
fileName - the name of the file to create.
fileFormat - the format of the file to create.
columnHeaderVariables - the variables whose values will be written to this file. If null, all values from every added vector will be written to this file.
vectorFormat - the vector format.
Throws:
java.lang.NullPointerException - if any argument except variables is null.

ComoFile

public ComoFile(java.lang.String fileName,
                FileFormat fileFormat,
                java.lang.String allColumnHeaderVariables,
                MapFormat<K,V> vectorFormat)
Constructs a new column-oriented vector output file from the provided arguments.

Parameters:
fileName - the name of the file to create.
fileFormat - the format of the file to create.
allColumnHeaderVariables - a string representation of the variables whose values will be written to this file. This string is parsed by the provided vector format.
vectorFormat - the vector format.
Throws:
java.lang.NullPointerException - if any argument is null.

ComoFile

public ComoFile(java.lang.String fileName,
                java.util.Set<? extends K> columnHeaderVariables,
                MapFormat<K,V> vectorFormat)
Constructs a new text-based column-oriented map output file from the provided arguments.

Parameters:
fileName - the name of the file to create.
columnHeaderVariables - the variables whose values will be written to this file.
vectorFormat - the vector format.
Throws:
java.lang.NullPointerException - if any argument except variables is null.
Method Detail

addData

public void addData(java.util.Map<? extends K,? extends V> map)
Writes the appropriate values of the provided vector to this file. The appropriate values are those of the variables in the set returned by AbstractMapOutputFile.getFilterKeys().

Parameters:
map - the vector to be written to this file.
Throws:
java.lang.IllegalArgumentException - if the provided vector does not contain all the variables in the set returned by AbstractMapOutputFile.getFilterKeys().
java.lang.IllegalStateException - if close() has already been called.