|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.datavision.source.DataSource
jimm.datavision.source.charsep.CharSepSource
public class CharSepSource
A data source for files whose lines are rows and columns are separated by a character.
| Field Summary | |
|---|---|
protected java.util.ArrayList |
columns
|
protected static char |
DEFAULT_SEP_CHAR
|
protected java.io.BufferedReader |
reader
|
protected char |
sepChar
|
protected java.lang.String |
sourceFilePath
|
| Fields inherited from class jimm.datavision.source.DataSource |
|---|
metadataURL, query, report |
| Constructor Summary | |
|---|---|
CharSepSource(Report report)
|
|
| Method Summary | |
|---|---|
void |
addColumn(Column col)
This override not only remembers the column but also hands it to the query for cacheing. |
boolean |
alreadyUsedSourceFile()
Returns true if this data source uses a file to retrieve
data and and has already done so. |
boolean |
areRecordsSelectable()
Used to enable/disable the "Select Records" menu item. |
boolean |
areRecordsSortable()
Used to enable/disable the "Sort By" menu item. |
boolean |
canGroupRecords()
Used to enable/disable the "Group By" menu item. |
boolean |
canJoinTables()
Used to enable/disable the "Table Linker" menu item. |
(package private) void |
closeReader()
|
java.util.Iterator |
columns()
Returns an iterator over all columns. |
protected void |
doWriteXML(XMLWriter out)
Writes this database and all its tables as an XML tag. |
DataCursor |
execute()
|
Column |
findColumn(java.lang.Object id)
Given an id (a column name), returns the column that has that id. |
(package private) java.io.BufferedReader |
getReader()
|
char |
getSepChar()
|
java.lang.String |
getSourceFile()
Gets the path to a data source file. |
int |
indexOfSelectable(Selectable sel)
Returns the index of the specified selectable. |
boolean |
isConnectionEditable()
Used to enable/disable the "Connection" menu item. |
boolean |
isSQLGenerated()
Used to enable/disable the "SQL Query Text" menu item. |
boolean |
needsSourceFile()
Returns true if this data source uses a file to retrieve
data and does not yet have one. |
void |
reuseSourceFile()
Tells this data source to re-use (perhaps re-open) the current data source file. |
void |
setInput(java.io.InputStreamReader inputStreamReader)
|
void |
setInput(java.io.Reader reader)
|
void |
setInput(java.lang.String fileName)
|
void |
setSepChar(char c)
|
void |
setSourceFile(java.lang.String filePath)
Accepts the path to a data source file. |
java.util.Iterator |
tables()
Returns an iterator over all tables, or null if the
data source does not have tables (for example, a character-separated
file data source). |
java.util.Iterator |
tablesUsedInReport()
Returns an iterator over all tables actually used in the report, or null if the data source does not have tables (for example,
a character-separated file data source). |
boolean |
usesSourceFile()
Returns true if this data source uses a file to retrieve
data. |
| Methods inherited from class jimm.datavision.source.DataSource |
|---|
canRunReports, columnsInTablesUsedInReport, containsReferenceTo, getQuery, getReport, readMetadataFrom, reloadColumns, removeSort, writeXML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char DEFAULT_SEP_CHAR
protected java.util.ArrayList columns
protected char sepChar
protected java.io.BufferedReader reader
protected java.lang.String sourceFilePath
| Constructor Detail |
|---|
public CharSepSource(Report report)
| Method Detail |
|---|
public boolean canJoinTables()
DataSource
canJoinTables in class DataSourcetrue if the "Table Linker" menu item
should be enabled.public boolean isSQLGenerated()
DataSource
isSQLGenerated in class DataSourcetrue if the "SQL Query Text" menu item
should be enabled.public boolean isConnectionEditable()
DataSource
isConnectionEditable in class DataSourcetrue if the "Connection" menu item
should be enabled.public boolean areRecordsSelectable()
DataSource
areRecordsSelectable in class DataSourcetrue if the "Select Records" menu item
should be enabled.public boolean areRecordsSortable()
DataSource
areRecordsSortable in class DataSourcetrue if the "Sort By" menu item
should be enabled.public boolean canGroupRecords()
DataSource
canGroupRecords in class DataSourcetrue if the "Group By" menu item
should be enabled.public boolean usesSourceFile()
DataSourcetrue if this data source uses a file to retrieve
data. The default implementation returns false.
usesSourceFile in class DataSourcetrue if this data source uses a file to retrieve
datapublic boolean needsSourceFile()
DataSourcetrue if this data source uses a file to retrieve
data and does not yet have one. The default implementation returns false.
needsSourceFile in class DataSourcetrue if this data source uses a file to retrieve
data and doesn't yet have onepublic boolean alreadyUsedSourceFile()
DataSourcetrue if this data source uses a file to retrieve
data and and has already done so. The default implementation returns false.
alreadyUsedSourceFile in class DataSourcetrue if this data source uses a file to retrieve
datapublic java.lang.String getSourceFile()
DataSource
getSourceFile in class DataSource
public void setSourceFile(java.lang.String filePath)
throws java.io.FileNotFoundException
DataSource
setSourceFile in class DataSourcefilePath - the full path to a file
java.io.FileNotFoundException
public void reuseSourceFile()
throws java.io.FileNotFoundException
DataSource
reuseSourceFile in class DataSourcejava.io.FileNotFoundExceptionpublic void setInput(java.io.Reader reader)
public void setInput(java.io.InputStreamReader inputStreamReader)
public void setInput(java.lang.String fileName)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic char getSepChar()
public void setSepChar(char c)
public void addColumn(Column col)
addColumn in class DataSourcecol - a columnpublic Column findColumn(java.lang.Object id)
null. Uses
Table.findColumn.
findColumn in class DataSourceid - a column id
null if no column with the specified
id existsTable.findColumn(java.lang.Object)public int indexOfSelectable(Selectable sel)
DataSource
indexOfSelectable in class DataSourcesel - a selectablepublic java.util.Iterator tables()
DataSourcenull if the
data source does not have tables (for example, a character-separated
file data source).
tables in class DataSourcenull iterator over all tablespublic java.util.Iterator tablesUsedInReport()
DataSourcenull if the data source does not have tables (for example,
a character-separated file data source).
tablesUsedInReport in class DataSourcenull iterator over all tables used
in the reportpublic java.util.Iterator columns()
DataSource
columns in class DataSourcepublic DataCursor execute()
execute in class DataSourcejava.io.BufferedReader getReader()
void closeReader()
protected void doWriteXML(XMLWriter out)
doWriteXML in class DataSourceout - a writer that knows how to write XML
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||