|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.table.io.DelimitedExportManager
public class DelimitedExportManager
DelimitedExportManager writes a table model in a delimited format.
Field Summary | |
---|---|
static String |
DEFAULT_NEWLINE
the default new line as "\r\n" |
protected String |
delimiter
the delimiter string |
protected String |
newline
the newline string |
protected boolean |
writeHeader
boolean variable for writing the header of the table model. |
Constructor Summary | |
---|---|
DelimitedExportManager()
Constructs a DelimitedExportManager with a comma (,) as the delimiter. |
|
DelimitedExportManager(String delimiter)
Constructs a DelimitedExportManager. |
Method Summary | |
---|---|
protected String |
format(TableModel model,
int row,
int column)
Returns the value of a specified cell as a string. |
protected String |
formatHeader(String value)
Returns a formatted string of a table's column name. |
String |
getDelimiter()
Returns the current delimiter. |
String |
getHeader(TableModel model)
Returns the table model header. |
boolean |
getWriteHeader()
Determines whether we want the column values of the table model to be output as well. |
void |
setDelimiter(String delimiter)
Assigns a new delimiter string. |
void |
setWriteHeader(boolean writeHeader)
Assigns a variable that is true if the column values of the table model will be output as well. |
void |
write(TableModel model,
OutputStream out)
Writes model to the outputstream out . |
void |
write(TableModel model,
Writer writer)
Writes model to the writer writer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String delimiter
public static final String DEFAULT_NEWLINE
protected String newline
protected boolean writeHeader
Constructor Detail |
---|
public DelimitedExportManager()
public DelimitedExportManager(String delimiter)
Method Detail |
---|
protected String format(TableModel model, int row, int column)
model
- the table modelrow
- the row indexcolumn
- the column index
public String getDelimiter()
public String getHeader(TableModel model)
public boolean getWriteHeader()
public void setDelimiter(String delimiter)
delimiter
- the new delimiter string to assignpublic void setWriteHeader(boolean writeHeader)
writeHeader
- true if the column header is to be written to the stream.public void write(TableModel model, OutputStream out)
model
to the outputstream out
.
write
in interface ExportManager
model
- the table model to writeout
- the output stream to write toprotected String formatHeader(String value)
value
- the value of the colunmn
public void write(TableModel model, Writer writer)
model
to the writer writer
.
write
in interface ExportManager
model
- the table model to writewriter
- the writer to write to
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |