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

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

public class RomoFileSource<K,V>
extends java.lang.Object
implements java.util.Iterator<RomoFile<K,V>>

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

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

Constructor Summary
RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, MapFormat<K,V> mapFormat)
          Constructs a new source of row-oriented map output files.
RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, java.util.Set<? extends K> keys, MapFormat<K,V> mapFormat)
          Constructs a new source of row-oriented map output files.
RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource, FileFormat fileFormat, java.lang.String keys, MapFormat<K,V> mapFormat)
          Constructs a new source of row-oriented map output files.
 
Method Summary
 FileFormat getFileFormat()
          Returns the format used to create files of type RomoFile.
 MapFormat<K,V> getLineFormat()
          Returns the map format used to create files of type RomoFile.
 boolean hasNext()
          Indicates if this iterator can return another file using the next() method .
 RomoFile<K,V> next()
          Returns the next row-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

RomoFileSource

public RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      java.util.Set<? extends K> keys,
                      MapFormat<K,V> mapFormat)
Constructs a new source of row-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.

RomoFileSource

public RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      java.lang.String keys,
                      MapFormat<K,V> mapFormat)
Constructs a new source of row-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.

RomoFileSource

public RomoFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      MapFormat<K,V> mapFormat)
Constructs a new source of row-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 RomoFile.

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

getFileFormat

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

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

hasNext

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

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

next

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

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

remove

public void remove()
Throws UnsupportedOperationException.

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