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

java.lang.Object
  extended by sbrt.shell.io.ComoFileSource<K,V>
Type Parameters:
K - the key type.
V - the value type.
All Implemented Interfaces:
java.util.Iterator<ComoFile<K,V>>

public class ComoFileSource<K,V>
extends java.lang.Object
implements java.util.Iterator<ComoFile<K,V>>

This class is used to provided a source of column-oriented map output files.

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

Constructor Summary
ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, MapFormat<K,V> mapFormat)
          Constructs a new source of column-oriented map output files.
ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, java.util.Set<? extends K> keys, MapFormat<K,V> mapFormat)
          Constructs a new source of column-oriented map output files.
ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, java.lang.String keys, MapFormat<K,V> mapFormat)
          Constructs a new source of column-oriented map output files.
 
Method Summary
 FileFormat getFileFormat()
          Returns the format used to create files of type ComoFile.
 MapFormat<K,V> getLineFormat()
          Returns the map format used to create files of type ComoFile.
 boolean hasNext()
          Indicates if this iterator can return another file using the next() method .
 ComoFile<K,V> next()
          Returns the next column-oriented map output file with the next name returned by the file name source.
 void remove()
          Throws UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComoFileSource

public ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      java.util.Set<? extends K> keys,
                      MapFormat<K,V> mapFormat)
Constructs a new source of column-oriented map output files.

Parameters:
fileNameSource - the file name source.
fileFormat - the file format used to write files.
keys - the keys whose values will be written to the files produced by this source. If null, all values from every added map will be written to this file.
mapFormat - the format used to write string representations of maps.
Throws:
java.lang.NullPointerException - if any argument except keys is null.

ComoFileSource

public ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      java.lang.String keys,
                      MapFormat<K,V> mapFormat)
Constructs a new source of column-oriented map output files.

Parameters:
fileNameSource - the file name source.
fileFormat - the file format used to write files.
keys - a string representation of the keys whose values will be written to the files produced by this source.
mapFormat - the format used to write string representations of maps.
Throws:
java.lang.NullPointerException - if any argument is null.

ComoFileSource

public ComoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      MapFormat<K,V> mapFormat)
Constructs a new source of column-oriented map output files.

Parameters:
fileNameSource - the file name source.
fileFormat - the file format used to write files.
mapFormat - the format used to write string representations of maps.
Throws:
java.lang.NullPointerException - if any argument is null.
Method Detail

getLineFormat

public MapFormat<K,V> getLineFormat()
Returns the map format used to create files of type ComoFile.

Returns:
the map format used to create files of type ComoFile.

getFileFormat

public FileFormat getFileFormat()
Returns the format used to create files of type ComoFile.

Returns:
the format used to create files of type ComoFile.

hasNext

public boolean hasNext()
Indicates if this iterator can return another file using the next() method .

Specified by:
hasNext in interface java.util.Iterator<ComoFile<K,V>>
Returns:
true if this iterator can return another file; false otherwise.

next

public ComoFile<K,V> next()
Returns the next column-oriented map output file with the next name returned by the file name source.

Specified by:
next in interface java.util.Iterator<ComoFile<K,V>>
Returns:
the next column-oriented map output file.

remove

public void remove()
Throws UnsupportedOperationException.

Specified by:
remove in interface java.util.Iterator<ComoFile<K,V>>
Throws:
java.lang.UnsupportedOperationException