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

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

public class ComiFileSource<K,V>
extends java.lang.Object
implements java.util.Iterator<ComiFile<K,V>>

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

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

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

ComiFileSource

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

ComiFileSource

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

Parameters:
fileNameSource - the file name source.
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 except keys is null.

ComiFileSource

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

getLineFormat

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

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

getFileFormat

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

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

hasNext

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

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

next

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

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

remove

public void remove()
Throws UnsupportedOperationException.

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