|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.io.AbstractMapInputFile<K,V>
sbrt.shell.io.ComiFile<K,V>
K
- the key type.V
- the value type.public class ComiFile<K,V>
This class is used to read column-oriented map input files.
Constructor Summary | |
---|---|
ComiFile(java.lang.String fileName,
FileFormat fileFormat,
MapFormat<K,V> mapFormat)
Constructs a new row-oriented map input file from the provided arguments. |
|
ComiFile(java.lang.String fileName,
FileFormat fileFormat,
java.util.Set<? extends K> requiredKeys,
MapFormat<K,V> mapFormat)
Constructs a new row-oriented map input file from the provided arguments. |
|
ComiFile(java.lang.String fileName,
MapFormat<K,V> mapFormat)
Constructs a new row-oriented map input file from the provided arguments. |
Method Summary | |
---|---|
java.util.Set<K> |
getKeys()
Returns the map keys (column headers) contained in this file. |
static SparseDoubleMatrix<java.lang.Integer,java.lang.String> |
getMatrix(ComiFile<java.lang.String,java.lang.Double> file)
Reads the provided column-oriented map input file and returns its contents as a sparse matrix. |
java.util.Iterator<java.util.Map<K,V>> |
iterator()
Returns an iterator over this file. |
java.util.Iterator<java.util.Map<K,V>> |
iterator(int mapIndex)
Returns an iterator over this file beginning at the specified index. |
Methods inherited from class sbrt.shell.io.AbstractMapInputFile |
---|
close, getCanonicalName, getMapFormat, getOriginalName, getRequiredKeys, isClosed, lineIterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComiFile(java.lang.String fileName, FileFormat fileFormat, java.util.Set<? extends K> requiredKeys, MapFormat<K,V> mapFormat)
fileName
- the name of the file to read.fileFormat
- the format of the file.requiredKeys
- the keys that are required to be
in the file.mapFormat
- the format used to parse the file.public ComiFile(java.lang.String fileName, FileFormat fileFormat, MapFormat<K,V> mapFormat)
fileName
- the name of the file to read.fileFormat
- the format of the file.mapFormat
- the format used to parse the file.public ComiFile(java.lang.String fileName, MapFormat<K,V> mapFormat)
fileName
- the name of the file to read.mapFormat
- the format used to parse the file.Method Detail |
---|
public static SparseDoubleMatrix<java.lang.Integer,java.lang.String> getMatrix(ComiFile<java.lang.String,java.lang.Double> file)
file
- the file to be read.
public java.util.Set<K> getKeys()
public java.util.Iterator<java.util.Map<K,V>> iterator()
public java.util.Iterator<java.util.Map<K,V>> iterator(int mapIndex)
0
, and commented or blank lines are
ignored.
mapIndex
- the index of the map at which this iterator begins.
java.lang.IndexOutOfBoundsException
- if the provided index exceeds the
number of maps contained in the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |