|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object infovis.io.AbstractReader infovis.table.io.AbstractTableReader infovis.table.io.CSVTableReader
public class CSVTableReader
Read an Excel CSV format into a table.
Constructor Summary | |
---|---|
CSVTableReader(InputStream in,
String name,
Table table)
Constructor. |
|
CSVTableReader(InputStream in,
Table table)
Constructor. |
Method Summary | |
---|---|
boolean |
addField(int column,
String field)
Adds the value of specified column. |
void |
addLabel(String name)
Adds a label. |
String |
defaultFieldName(int index)
Returns a default field name for a specified index. |
Column |
getColumnAt(int index)
Returns the column at the specified index in the label table. |
String |
getField()
Returns a string from the current buffer content. |
String |
getLabelAt(int index)
Returns the label at the specified index. |
char |
getSeparator()
Returns the column separator character. |
int |
getSkipLines()
Returns the number of lines to skip at the begining of the file. |
boolean |
isConsideringQuotes()
Returns the consideringQuotes. |
boolean |
isLabelLinePresent()
Returns true if the first line contains labels. |
boolean |
isTypeLinePresent()
Returns true if a line containing the types should be
read. |
boolean |
load()
Main method for loading the file. |
static boolean |
load(File file,
Table t)
Loads the specified file in the specified table. |
boolean |
nextField(int col)
Read the next field, storing it in buffer and returns false if it ends the line. |
void |
setConsideringQuotes(boolean consideringQuotes)
Sets the consideringQuotes. |
void |
setLabelLinePresent(boolean labelLinePresent)
Sets whether the first line contains labels. |
void |
setSeparator(char separator)
Sets the column separator character. |
void |
setSkipLines(int skipLines)
Sets the number of lines to skip at the begining of the file. |
void |
setTypeLinePresent(boolean typeLinePresent)
Sets the typeLinePresent. |
Methods inherited from class infovis.table.io.AbstractTableReader |
---|
close, getBuffer, getBufferedReader, getCommentChar, getIn, getTable, ignoreLine, isEof, read, readInt, readLine, readQuoted, setBuffer, setCommentChar, setEof, setTable, skipToEol |
Methods inherited from class infovis.io.AbstractReader |
---|
createColumn, getEncoding, getName, guessFieldType, setEncoding, setIn, setName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVTableReader(InputStream in, Table table)
in
- the input streamtable
- the tablepublic CSVTableReader(InputStream in, String name, Table table)
in
- the input streamname
- the nametable
- the tableMethod Detail |
---|
public char getSeparator()
public void setSeparator(char separator)
separator
- the column separator character. The separator to setpublic boolean isLabelLinePresent()
true
if the first line contains labels.
true
if the first line contains labels.public void setLabelLinePresent(boolean labelLinePresent)
labelLinePresent
- true
the first line contains labels.public boolean isTypeLinePresent()
true
if a line containing the types should be
read.
true
if a line containing the types should be
read.public void setTypeLinePresent(boolean typeLinePresent)
typeLinePresent
- The typeLinePresent to setpublic boolean isConsideringQuotes()
public void setConsideringQuotes(boolean consideringQuotes)
consideringQuotes
- The consideringQuotes to setpublic int getSkipLines()
public void setSkipLines(int skipLines)
skipLines
- the number of lines to skip at the begining of the file.public boolean nextField(int col) throws IOException
col
- the column
IOException
- pass exception from BufferedReaderpublic String defaultFieldName(int index)
index
- the index.
public String getLabelAt(int index)
index
- the index
public void addLabel(String name)
name
- the labelpublic Column getColumnAt(int index)
index
- the index
public boolean addField(int column, String field) throws ParseException
column
- DOCUMENT ME!field
- DOCUMENT ME!
ParseException
- DOCUMENT ME!public boolean load()
AbstractReader
load
in class AbstractReader
AbstractReader.load()
public String getField()
getField
in class AbstractTableReader
public static boolean load(File file, Table t)
file
- the filet
- the table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |