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

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

public class RomiFileSource<K,V>
extends java.lang.Object
implements java.util.Iterator<RomiFile<K,V>>

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

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

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

RomiFileSource

public RomiFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      FileFormat fileFormat,
                      java.util.Set<? extends K> requiredKeys,
                      MapFormat<K,V> mapFormat)
Constructs a new source of row-oriented map input files.

Parameters:
fileNameSource - the file name source.
fileFormat - the file format used to read files.
requiredKeys - the keys required to be present in each input file.
mapFormat - the format used to read string representations of maps.
Throws:
java.lang.NullPointerException - if any argument is null.

RomiFileSource

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

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

RomiFileSource

public RomiFileSource(java.util.Iterator<java.lang.String> fileNameSource,
                      MapFormat<K,V> mapFormat)
Constructs a new source of row-oriented map input files.

Parameters:
fileNameSource - the file name source.
mapFormat - the format used to read 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 RomiFile.

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

getFileFormat

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

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

hasNext

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

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

next

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

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

remove

public void remove()
Throws UnsupportedOperationException.

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