public class TextDataset extends IODataset
Constructor and Description |
---|
TextDataset(java.io.File dataSource,
int width,
int height)
Creates a new TextDataset from the specified file.
|
TextDataset(java.io.File dataSource,
java.lang.String delim,
int width,
int height)
Creates a new TextDataset from the specified file.
|
TextDataset(java.io.File dataSource,
java.lang.String delim,
java.lang.String commentChar,
int width,
int height)
Creates a new TextDataset from the specified file.
|
TextDataset(java.lang.String dataFileName,
int width,
int height)
Creates a new TextDataset from the specified file.
|
TextDataset(java.lang.String dataFileName,
java.lang.String delim,
int width,
int height)
Creates a new TextDataset from the specified file.
|
TextDataset(java.lang.String dataFileName,
java.lang.String delim,
java.lang.String commentChar,
int width,
int height)
Creates a new TextDataset from the specified file.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCommentChar()
Gets the comment character.
|
java.lang.String |
getDelim()
Returns the token delimiter.
|
java.util.List<java.util.List<java.lang.String>> |
getStringData()
Returns the String tokens from the data file, i.e.
|
void |
read()
Reads the data file.
|
static java.util.List<java.util.List<java.lang.String>> |
readAsString(java.io.File dataFile,
java.lang.String delim,
java.lang.String commentChar)
Reads and returns an array of elements from a delimited ASCII stringData file.
|
void |
setCommentChar(java.lang.String commentChar)
Sets the comment character.
|
void |
setDelim(java.lang.String delim)
Sets the token delimiter.
|
public TextDataset(java.io.File dataSource, int width, int height) throws java.io.IOException
dataSource
- file to readwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic TextDataset(java.lang.String dataFileName, int width, int height) throws java.io.IOException
dataFileName
- file to readwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic TextDataset(java.io.File dataSource, java.lang.String delim, java.lang.String commentChar, int width, int height) throws java.io.IOException
dataSource
- file to readdelim
- token delimitercommentChar
- comment characterwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic TextDataset(java.lang.String dataFileName, java.lang.String delim, java.lang.String commentChar, int width, int height) throws java.io.IOException
dataFileName
- file to readdelim
- token delimitercommentChar
- comment characterwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic TextDataset(java.io.File dataSource, java.lang.String delim, int width, int height) throws java.io.IOException
dataSource
- file to readdelim
- token delimiterwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic TextDataset(java.lang.String dataFileName, java.lang.String delim, int width, int height) throws java.io.IOException
dataFileName
- file to readdelim
- token delimiterwidth
- width of dataheight
- height of datajava.io.IOException
- if an I/O error occurspublic static java.util.List<java.util.List<java.lang.String>> readAsString(java.io.File dataFile, java.lang.String delim, java.lang.String commentChar) throws java.io.IOException
dataFile
- file to readdelim
- character used to delimit elements in the filecommentChar
- lines beginning with this character are treated as comments and ignoredjava.io.IOException
- if an error occurs reading the filepublic void read() throws java.io.IOException
public java.lang.String getDelim()
public void setDelim(java.lang.String delim)
delim
- token delimiterpublic java.lang.String getCommentChar()
public void setCommentChar(java.lang.String commentChar)
commentChar
- comment characterpublic java.util.List<java.util.List<java.lang.String>> getStringData()