be.ac.ulg.montefiore.run.totem.visualtopo.guiComponents.domainTables.tableExport
Class TxtTableExporter
java.lang.Object
be.ac.ulg.montefiore.run.totem.visualtopo.guiComponents.domainTables.tableExport.TxtTableExporter
- All Implemented Interfaces:
- TableExporter
public class TxtTableExporter
- extends java.lang.Object
- implements TableExporter
Exports a Jtable as a text file. Intended to work with tables that use row selections. If some rows are selected,
only those ones are exported. In none is selected, the whole table is exported.
The first record will contain the column names beginning with a LINE_COMMENT
and separated by a
COL_DELIMITER
. Then a ROW_DELIMITER
is written. Each row of the table is represented
by their cell values separated by a COL_DELIMITER
and the rows are separated by a ROW_DELIMITER
.
Creation date: 27/04/2007
- Author:
- Gaƫl Monfort (monfort@run.montefiore.ulg.ac.be)
Method Summary |
void |
export(java.io.File file,
javax.swing.JTable table)
Exports the given table to the given text file. |
void |
export(java.lang.String fileName,
javax.swing.JTable table)
Exports the given table to the given text file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ROW_DELIMITER
public static final java.lang.String ROW_DELIMITER
- See Also:
- Constant Field Values
COL_DELIMITER
public static final java.lang.String COL_DELIMITER
- See Also:
- Constant Field Values
LINE_COMMENT
public static final java.lang.String LINE_COMMENT
- See Also:
- Constant Field Values
TxtTableExporter
public TxtTableExporter()
export
public void export(java.lang.String fileName,
javax.swing.JTable table)
throws java.io.IOException
- Exports the given table to the given text file.
- Specified by:
export
in interface TableExporter
- Parameters:
fileName
- Name of the filetable
- Table to export
- Throws:
java.io.IOException
- Thrown if an error occurs while writing to the file.
export
public void export(java.io.File file,
javax.swing.JTable table)
throws java.io.IOException
- Exports the given table to the given text file.
- Specified by:
export
in interface TableExporter
- Parameters:
file
- a filetable
- Table to export
- Throws:
java.io.IOException
- Thrown if an error occurs while writing to the file.
Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.