public class ImportFileSource extends java.lang.Object implements ImportSource
Constructor and Description |
---|
ImportFileSource(java.io.File file) |
ImportFileSource(java.io.File file,
char fieldDelim,
char stringDelim) |
ImportFileSource(java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected ImportTextParser |
createParser() |
protected java.io.File |
getFile() |
java.lang.String |
getName() |
java.util.ArrayList |
getNext()
Get next set of values.
|
long |
getRows()
Return number of rows
If first time requested then open file again and load each line
We need to parse since readln does not handle new line in between
string delimiter
|
boolean |
hasMore() |
void |
rewind() |
void |
setFieldDelimiter(char delim) |
void |
setName(java.lang.String nm) |
void |
setStringDelimiter(char delim) |
public ImportFileSource(java.lang.String fileName)
fileName
- public ImportFileSource(java.io.File file)
file
- public ImportFileSource(java.io.File file, char fieldDelim, char stringDelim)
file
- fieldDelim
- stringDelim
- public java.lang.String getName()
getName
in interface ImportSource
public void setName(java.lang.String nm)
setName
in interface ImportSource
nm
- public void rewind() throws java.lang.Exception
rewind
in interface ImportSource
java.lang.Exception
- a serious problempublic java.util.ArrayList getNext() throws java.lang.Exception
ImportSource
getNext
in interface ImportSource
fieldArray
- java.lang.Exception
- a serious problempublic void close()
close
in interface ImportSource
public void setFieldDelimiter(char delim)
delim
- public void setStringDelimiter(char delim)
delim
- public boolean hasMore()
hasMore
in interface ImportSource
public long getRows() throws java.io.IOException
getRows
in interface ImportSource
java.io.IOException
protected ImportTextParser createParser() throws java.io.IOException
java.io.IOException
protected java.io.File getFile()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.