|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.mp3dings.export.AbstractExporter
public abstract class AbstractExporter
An Exporter that exports a file composed of a header section,
a main section with one block per record and a footer section.
| Constructor Summary | |
|---|---|
AbstractExporter()
|
|
| Method Summary | |
|---|---|
int |
export(Object[] keys,
Object[][] data)
Equivalent to export(field, data, null). |
int |
export(Object[] keys,
Object[][] data,
StringBuffer filename)
Opens a JFileChooser using the file
filter returned by getFileFilter() and exports the
current data to the selected file. |
protected abstract String |
getBlock(int blockIndex,
Map blockdata)
Produces a single data entry in the exported file. |
Object[] |
getBlockKeys()
Returns the block keys used by this exporter. |
String |
getExtension()
Returns the file extension for an exporter's target file type. |
boolean |
getFileFallback()
Returns whether the client should try to read data that is not found in the table directly from the mp3 file. |
FileFilter |
getFileFilter()
Retrieve the file filter that determines which files can be selected as an export target. |
protected abstract String |
getFooter(int NumEntries)
Produces the footer section of the exported file. |
Map |
getFooterData()
Returns the current footer data. |
Object[] |
getFooterKeys()
Returns the footer keys used by this exporter. |
protected abstract String |
getHeader()
Produces the header section of the exported file. |
Map |
getHeaderData()
Returns the current header data. |
Object[] |
getHeaderKeys()
Returns the header keys used by this exporter. |
static String[] |
getImplementations()
Returns known instantiable sub-classes with a public no-argument constructor. |
Object[] |
getKeys()
Returns all keys used by this exporter in a single array. |
abstract String |
getName()
Returns a string description of an exporter's target type. |
int |
getNumberOfEntries()
Gets the number of datasets in the last call to export(Object[] fields, Object[][] data) |
boolean |
setEncoding(String enc)
Sets the charset that will be used to encode the strings for exporting. |
void |
setFileFallback(boolean b)
Sets whether the client should try to read data that is not found in the table directly from the mp3 file. |
void |
setFooterData(Map fd)
Sets the footer data that getFooter(int) will use to generate
the footer section |
void |
setHeaderData(Map hd)
Sets the header data that getHeader() will use to generate
the header section. |
void |
setKeys(Object[] headerKeys,
Object[] blockKeys,
Object[] footerKeys)
Sets the keys for a specific implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractExporter()
| Method Detail |
|---|
public boolean setEncoding(String enc)
setEncoding in interface Exporterenc - The name of the charset; may be either a canonical name or an aliasExporter.setEncoding(String enc)public Object[] getKeys()
Fields.
getKeys in interface ExporterExporter.getKeys(),
getHeaderKeys(),
getBlockKeys(),
getFooterKeys()
public void setKeys(Object[] headerKeys,
Object[] blockKeys,
Object[] footerKeys)
headerKeys - the fields for the headerblockKeys - the fields for the main sectionfooterKeys - the fields for the footergetKeys()public void setHeaderData(Map hd)
getHeader() will use to generate
the header section. Changes to the specified Map will result
in changes in the exported data.
hd - Map containing the header data. The keys whose values
should be populated can be retrieved using getHeaderKeys().public Map getHeaderData()
setHeaderData(Map )public void setFooterData(Map fd)
getFooter(int) will use to generate
the footer section
fd - Map containing the footer data. Its keys can be
retrieved using getFooterKeys().public Map getFooterData()
setFooterData(Map )public int getNumberOfEntries()
export(Object[] fields, Object[][] data)
public Object[] getHeaderKeys()
Fields.
getKeys(),
setHeaderData(Map )public Object[] getBlockKeys()
Fields.
getKeys()public Object[] getFooterKeys()
Fields.
getKeys()
public int export(Object[] keys,
Object[][] data)
throws ExportException
export(field, data, null).
export in interface Exporterdata - data[i][j] is the value for
keys[j] in the ith record
ExportExceptionexport(Object[], Object[][], StringBuffer)
public int export(Object[] keys,
Object[][] data,
StringBuffer filename)
throws ExportException
JFileChooser using the file
filter returned by getFileFilter() and exports the
current data to the selected file. The exported file is composed of
getHeader()getBlock(int, Map)) for each
dataset in the data arraygetFooter(int).
keys - an array containing the fields the data contains.data - a 2D array of block data. The first index designates
the number of the dataset, the second index designates the
data field. data[i][j] is the value of field keys[j] for
the ith dataset.filename - name of the file to export to. If null or empty the user
will be prompted for a value. A non-null object will hold the
finally used filename after a succesfull call, and null after
an unsuccessful call.
ExportException
protected abstract String getBlock(int blockIndex,
Map blockdata)
export(Object[] keys, Object[][] data)protected abstract String getHeader()
getHeaderData().
protected abstract String getFooter(int NumEntries)
getFooterData().
public FileFilter getFileFilter()
public boolean getFileFallback()
getFileFallback in interface Exporterpublic void setFileFallback(boolean b)
b - whether to read id3 tags as a fallbackpublic static String[] getImplementations()
public abstract String getName()
getName in interface Exporterpublic String getExtension()
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||