public class CSVTableModelProducer
extends java.lang.Object
TableModel
using a file formated in CSV for input. The
separation can be what ever you want (as it is an understandable regexp). The default
separator is a ,
.Constructor and Description |
---|
CSVTableModelProducer(java.io.BufferedReader r) |
CSVTableModelProducer(java.io.InputStream in) |
CSVTableModelProducer(java.lang.String filename) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getSeparator()
Returns the current separator used to parse the input.
|
javax.swing.table.TableModel |
getTableModel()
Creates the corrspondant TableModel of the input.
|
boolean |
isColumnNameFirstLine()
Tells if the first line of the input was column names.
|
javax.swing.table.TableModel |
parse()
Parses the input and stores data in a TableModel.
|
void |
setColumnNameFirstLine(boolean columnNameFirst)
Set if the first line of the input is column names or not.
|
void |
setSeparator(java.lang.String separator)
Sets the separator for parsing the input.
|
public CSVTableModelProducer(java.io.InputStream in)
public CSVTableModelProducer(java.lang.String filename) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public CSVTableModelProducer(java.io.BufferedReader r)
public void close() throws java.io.IOException
java.io.IOException
public javax.swing.table.TableModel parse() throws java.io.IOException
java.io.IOException
this.getTableModel()
public java.lang.String getSeparator()
public void setSeparator(java.lang.String separator)
String.split()
. The default separator is a ;
.separator
- a regexppublic javax.swing.table.TableModel getTableModel() throws java.io.IOException
java.io.IOException
public boolean isColumnNameFirstLine()
public void setColumnNameFirstLine(boolean columnNameFirst)
columnNameFirst
- boolean