|
ElegantJCharts Java API Specification v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.elegantj.data.dataprovider.AbstractDataProvider
This class encapsulates functionality of a abstract data provider. Subclass should override the retrieve() and save() methods.
| Field Summary | |
com.elegantj.editors.C11 |
c11
|
protected java.beans.PropertyChangeSupport |
changes
Specifies the PropertyChangeSupport object used to support the bound properties |
protected Table |
clientTable
Specifies the text data that user can use for transaction |
protected java.util.Vector |
columnNames
Specifies the vector containing the column names |
protected int |
currentIndex
Specifies the current index |
protected Table |
dataTable
Specifies the actual text data |
| Constructor Summary | |
AbstractDataProvider()
|
|
| Method Summary | |
void |
addDataListener(DataListener l)
Adds a DataListener |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addRow(java.util.Vector vector)
Adds the record |
int |
appendData(java.util.Vector data)
Appends the data |
protected void |
dataChanged(int id,
int oldIndex,
int currentIndex)
Fires the data event when the data has been changed |
protected void |
dataChanged(int id,
java.util.Vector oldVect,
java.util.Vector newVect)
Fires the data event when the data has been changed |
void |
deleteRow()
Deletes the record |
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
Checks whether the specified objects are equals or not |
void |
exportToSQL(java.sql.Connection conn,
java.lang.String tableName)
|
void |
exportToSQL(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String[] tableColumns)
Exports the data in the given database table |
void |
exportToSQL(java.lang.String url,
java.lang.String driver,
java.lang.String user,
java.lang.String password,
java.lang.String tableName)
|
void |
exportToSQL(java.lang.String url,
java.lang.String driver,
java.lang.String user,
java.lang.String password,
java.lang.String tableName,
java.lang.String[] tableColumns)
Exports the data in the given database table |
void |
exportToText(java.io.OutputStream out)
|
void |
exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
boolean columnsDelimited,
java.lang.String columnSeparator,
java.lang.String textQualifier,
java.lang.String columnsWidth)
Exports the data in text format to the given output stream, it takes the default value for the null or empty argument |
void |
exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
java.lang.String columnsWidth)
Exports the data in text format to the given output stream. |
void |
exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
java.lang.String columnSeparator,
java.lang.String textQualifier)
Exports the data in text format to the given output stream. |
void |
exportToXML(java.io.OutputStream out)
|
void |
exportToXML(java.io.OutputStream out,
java.lang.String rootTag,
java.lang.String rowTag,
java.lang.String columnTag,
boolean firstRowAsColumnNames)
Exports the data in xml format to the given output stream, it takes the default value for the null or empty argument |
void |
filterData(java.lang.String filter)
Filters the data with specified criteria |
int |
find(java.lang.String condition)
|
int |
find(java.lang.String condition,
int startIndex,
int endIndex)
Finds the record which satisfied the condition between startIndex and end Index, and return the index of the searched record |
int |
findNext()
Returns the index of the record which satisfied the condition after invoking the find() |
void |
fireDataChanged(int eventId,
java.util.Hashtable oldValue,
java.util.Hashtable newValue)
Invokes this method when the data has been changed |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Support for reporting bound property This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners. |
java.util.Vector |
firstRecord()
Moves to the first record and returns it |
int |
getColumnCount()
Returns the total number of columns |
int |
getColumnIndex(java.lang.String columnName)
Returns the index of the column colName |
java.util.Vector |
getColumnNames()
Returns the column names |
java.lang.String[] |
getColumnsArray()
Returns the column names |
java.lang.String |
getColumnSeparator()
Gets the column separator to export data in text format. |
java.lang.String |
getColumnsWidth()
Gets the width of each column if the column values are fixed width |
java.lang.String |
getColumnTag()
Gets the column tag to export the data in xml format |
int |
getColumnType(int colIndex)
Returns the type of the column at the specified index |
Computable |
getComputable()
Gets the Computable object which is used for filtering, searching and other computation operation |
int |
getCurrentIndex()
Returns the current index |
java.util.Vector |
getCurrentRecord()
Returns the current record |
java.util.Vector |
getData()
Fetches the data |
java.util.Vector |
getDataAt(int rowPosition)
Returns the record at the specified position |
java.lang.Object |
getDataAt(int rowPosition,
int columnPosition)
Returns the data value at the specified rowPosition and sepecified columnPosition |
int |
getDataCount()
Returns the total number of records |
DataProvider |
getDataProvider()
Gets the data Provider |
int |
getDeletedCount()
Returns the total number of the records has been deleted |
int |
getFetchSize()
Gets the fetch size |
java.lang.String |
getFilterCriteria()
Gets the criteria for filtering the data |
int |
getFilteredCount()
Returns the total number of the records has been filtered |
java.lang.String |
getLicenseKey()
Gets the license key |
int |
getModifiedCount()
Returns the total number of the records has been modified |
java.lang.String |
getRootTag()
Gets the root tag to export the data in xml format |
java.lang.String |
getRowSeparator()
Gets the row separator to export data in text format. |
java.lang.String |
getRowTag()
Gets the row tag to export the data in xml format |
int |
getSkippedRows()
Gets the total number of rows to be skipped while retrieving |
java.util.Vector |
getSortColumns()
Returns the two dimensional vector containing the sort column name and its sorting order as each element |
java.lang.String |
getSortCriteria()
Gets the criteria for sorting the data |
java.lang.String |
getTextQualifier()
Gets the text qualifier to export data in text format. |
int |
insertDataAt(java.util.Vector data,
int pos)
Inserts the data at the specified position |
boolean |
isAppendDataOnFetchNext()
Returns whether the next fetched data is appended or replaced to the existing data |
boolean |
isColumnsDelimited()
Gets whether the column values are delimited or fixed width |
boolean |
isFilterState()
Gets the filtering enability |
boolean |
isFirstRowAsColumnNames()
Gets whether the first row contains the column names or not |
boolean |
isSaveOnlyFilteredData()
Gets the save operation criteria |
java.util.Vector |
lastRecord()
Moves to the last record and returns it |
void |
modifyDataAt(java.util.Vector data,
int pos)
Modifies the data at specified position |
java.util.Vector |
nextRecord()
Moves to the next record and returns it |
static int[] |
parseInt(java.lang.String str)
Parses the comma separated integer values from the given string |
java.util.Vector |
previousRecord()
Moves to the previous record and returns it |
void |
rankData(int groupIndex,
java.util.Vector groupBands)
Generate rank data based on given group information |
void |
readExternal(java.io.ObjectInput in)
|
void |
refreshData()
Refreshes the fetched data. |
void |
removeAll()
Removes all the records |
void |
removeAt(int position)
Removes the record at specified position |
void |
removeDataListener(DataListener l)
Removes a DataListener |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
void |
removeRange(int startPos,
int endPos)
Removes the records between start position to end position |
boolean |
rollbackModifications()
Rolls back the modifications |
boolean |
saveModifications()
Saves the modifications |
java.util.Vector |
scrollToRow(int record)
Moves to the record at the specified index and returns it |
void |
setAppendDataOnFetchNext(boolean b)
Sets whether the next fetched data is appended or replaced to the existing data |
void |
setColumnsDelimited(boolean b)
Sets whether the column values are delimited or fixed width |
void |
setColumnSeparator(java.lang.String colSep)
Sets the column separator to export data in text format. |
void |
setColumnsWidth(java.lang.String widths)
Sets the width of each column if the column values are fixed width |
void |
setColumnTag(java.lang.String columnTag)
Sets the column tag to export the data in xml format |
void |
setData(java.util.Vector data)
Sets the data |
void |
setDataArray(java.util.Vector[] arrayData)
Sets the data |
void |
setDataProvider(DataProvider dataProvider)
Sets the data provider |
void |
setFetchSize(int size)
Sets the fetch size |
void |
setFilterCriteria(java.lang.String filter)
Sets the criteria for filtering the data, the criteria is any expression (arithmetical/database related), |
void |
setFilterState(boolean filterFlag)
Sets the filtering enability |
void |
setFirstRowAsColumnNames(boolean b)
Sets whether the first row contains the column names or not |
void |
setLicenseKey(java.lang.String key)
Sets the license key |
void |
setRootTag(java.lang.String rootTag)
Sets the root tag to export the data in xml format |
void |
setRowSeparator(java.lang.String rowSep)
Sets the row separator to export data in text format. |
void |
setRowTag(java.lang.String rowTag)
Sets the row tag to export the data in xml format |
void |
setSaveOnlyFilteredData(boolean b)
Sets the save operation criteria |
void |
setSkippedRows(int n)
Sets the total number of rows to be skipped while retrieving |
void |
setSortCriteria(java.lang.String sort)
Sets the criteria for sorting the data, the criteria includes the column names and the its sorting order, for example col1:true,col2:false,col3:true |
void |
setTextQualifier(java.lang.String qualifier)
Sets the text qualifier to export data in text format. |
void |
sortData(int[] colNo)
|
void |
sortData(int[] colNo,
boolean[] order)
|
void |
sortData(int[] colNo,
boolean[] order,
int fromIndex,
int toIndex)
Sorts the data for specified columns at column indices with specified sorting order and |
void |
sortData(int[] colNo,
int startIndex,
int endIndex)
|
void |
sortData(java.lang.String[] colName)
|
void |
sortData(java.lang.String[] colName,
boolean[] order)
|
void |
sortData(java.lang.String[] colName,
boolean[] order,
int startIndex,
int endIndex)
Sorts the data for specified columns with specified sorting order and range of the records |
void |
sortData(java.lang.String[] colName,
int startIndex,
int endIndex)
|
void |
sortData(java.util.Vector sortColumns)
Sorts the data with specified columns |
void |
writeExternal(java.io.ObjectOutput out)
Externalizable interface implementation to save and retrieve the state of this bean |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.elegantj.data.dataprovider.DataProvider |
isFetchNext, nextData, retrieve |
| Field Detail |
protected transient int currentIndex
protected transient Table dataTable
protected transient Table clientTable
protected transient java.util.Vector columnNames
protected transient java.beans.PropertyChangeSupport changes
public transient com.elegantj.editors.C11 c11
| Constructor Detail |
public AbstractDataProvider()
| Method Detail |
public void setLicenseKey(java.lang.String key)
key - the license keypublic java.lang.String getLicenseKey()
public void setRowSeparator(java.lang.String rowSep)
rowSep - the row separator to export data in text format.public java.lang.String getRowSeparator()
public void setColumnSeparator(java.lang.String colSep)
colSep - the column separator to export data in text format.public java.lang.String getColumnSeparator()
public void setTextQualifier(java.lang.String qualifier)
qualifier - the text qualifier to export data in text format.public java.lang.String getTextQualifier()
public void setFirstRowAsColumnNames(boolean b)
b - true to consider the first row as column namespublic boolean isFirstRowAsColumnNames()
public void setColumnsDelimited(boolean b)
b - true to consider the column values are delimited, otherwise fixed widthpublic boolean isColumnsDelimited()
public void setColumnsWidth(java.lang.String widths)
widths - the string contains comma separated value for column widthpublic java.lang.String getColumnsWidth()
public void exportToText(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public void exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
java.lang.String columnSeparator,
java.lang.String textQualifier)
throws java.io.IOException
java.io.IOException
public void exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
java.lang.String columnsWidth)
throws java.io.IOException
java.io.IOException
public void exportToText(java.io.OutputStream out,
java.lang.String rowSeparator,
boolean firstRowAsColumnNames,
boolean columnsDelimited,
java.lang.String columnSeparator,
java.lang.String textQualifier,
java.lang.String columnsWidth)
throws java.io.IOException
out - the Output stream in which the data will be pushedrowSeparator - the string which separates each rowfirstRowAsColumnNames - true if first row contains the column namescolumnsDelimited - true if each columns are separated by any character(s)columnSeparator - the string which separates each columntextQualifier - the string which identifies the string portioncolumnsWidth - the string which represents each column's width as comma separated values
java.io.IOExceptionpublic static int[] parseInt(java.lang.String str)
public void setRootTag(java.lang.String rootTag)
rootTag - the xml tag to represent the rootpublic java.lang.String getRootTag()
public void setRowTag(java.lang.String rowTag)
rowTag - the xml tag to represent the rowpublic java.lang.String getRowTag()
public void setColumnTag(java.lang.String columnTag)
columnTag - the xml tag to represent the columnpublic java.lang.String getColumnTag()
public void exportToXML(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public void exportToXML(java.io.OutputStream out,
java.lang.String rootTag,
java.lang.String rowTag,
java.lang.String columnTag,
boolean firstRowAsColumnNames)
throws java.io.IOException
out - the Output stream in which the data will be pushedrootTag - the xml tag to represent the rootrowTag - the xml tag to represent the rowcolumnTag - the xml tag to represent the columnfirstRowAsColumnNames - true if first row contains the column names
java.io.IOException
public void exportToSQL(java.lang.String url,
java.lang.String driver,
java.lang.String user,
java.lang.String password,
java.lang.String tableName)
throws java.lang.ClassNotFoundException,
java.sql.SQLException
java.lang.ClassNotFoundException
java.sql.SQLException
public void exportToSQL(java.lang.String url,
java.lang.String driver,
java.lang.String user,
java.lang.String password,
java.lang.String tableName,
java.lang.String[] tableColumns)
throws java.lang.ClassNotFoundException,
java.sql.SQLException
url - the database url, as an example driver - the name of the database driver classuser - the name of the database userpassword - the password relative to given usertableName - the name of database tabletableColumns - the database column names in which the data will be exported, skips
column, if the column name is null, default all the table columns.
java.lang.ClassNotFoundException
java.sql.SQLException
public void exportToSQL(java.sql.Connection conn,
java.lang.String tableName)
throws java.sql.SQLException
java.sql.SQLException
public void exportToSQL(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String[] tableColumns)
throws java.sql.SQLException
conn - the database connectiontableName - the name of database tabletableColumns - the database column names in which the data will be exported, skips
column, if the column name is null. By default all the table columns are considered.
The length of the column names array should be the same as the total number of columns this provider has.
java.sql.SQLExceptionpublic void addRow(java.util.Vector vector)
vector - the values of the recordpublic void deleteRow()
public java.util.Vector firstRecord()
firstRecord in interface DataProviderpublic java.util.Vector lastRecord()
lastRecord in interface DataProviderpublic java.util.Vector nextRecord()
nextRecord in interface DataProviderpublic java.util.Vector previousRecord()
previousRecord in interface DataProviderpublic java.util.Vector scrollToRow(int record)
scrollToRow in interface DataProviderrecord - the record index to be scrolled
public void refreshData()
refreshData in interface DataProviderpublic java.util.Vector getData()
getData in interface DataProviderpublic java.util.Vector getDataAt(int rowPosition)
getDataAt in interface DataProvider
public java.lang.Object getDataAt(int rowPosition,
int columnPosition)
getDataAt in interface DataProviderrowPosition - the position of the rowcolumnPosition - the position of the column
public int getDataCount()
getDataCount in interface DataProviderpublic int appendData(java.util.Vector data)
data - the vector contains the record
public int insertDataAt(java.util.Vector data,
int pos)
data - the vector contains the record
public void modifyDataAt(java.util.Vector data,
int pos)
data - the vector contains the recordpublic void setData(java.util.Vector data)
data - the two dimension vector contains the datapublic void setDataArray(java.util.Vector[] arrayData)
arrayData - the array of the vector contains the datapublic void removeAll()
public void removeAt(int position)
position - the position of the data to be removed
public void removeRange(int startPos,
int endPos)
startPos - the start position of the dataendPos - the from position of the datapublic int getColumnCount()
getColumnCount in interface DataProviderpublic java.util.Vector getColumnNames()
getColumnNames in interface DataProviderpublic java.lang.String[] getColumnsArray()
getColumnsArray in interface DataProviderpublic int getColumnIndex(java.lang.String columnName)
getColumnIndex in interface DataProvidercolumnName - the name of the column
public int getColumnType(int colIndex)
getColumnType in interface DataProvidercolIndex - the index of the column
public int getCurrentIndex()
getCurrentIndex in interface DataProviderpublic java.util.Vector getCurrentRecord()
getCurrentRecord in interface DataProviderpublic Computable getComputable()
getComputable in interface DataProviderpublic void setFilterState(boolean filterFlag)
setFilterState in interface DataProviderfilterFlag - true, if the filtering is enabledpublic boolean isFilterState()
isFilterState in interface DataProviderpublic void setSaveOnlyFilteredData(boolean b)
b - true to save only filtered data, false to save all datapublic boolean isSaveOnlyFilteredData()
public void filterData(java.lang.String filter)
filterData in interface DataProviderfilter - the criteria to be processed to filter the datapublic void sortData(java.util.Vector sortColumns)
sortColumns - the two dimensional vector contains the column name and
its sorting order as each elementpublic void sortData(java.lang.String[] colName)
sortData in interface DataProviderpublic void sortData(int[] colNo)
sortData in interface DataProvider
public void sortData(java.lang.String[] colName,
boolean[] order)
sortData in interface DataProvider
public void sortData(int[] colNo,
boolean[] order)
sortData in interface DataProvider
public void sortData(java.lang.String[] colName,
int startIndex,
int endIndex)
sortData in interface DataProvider
public void sortData(int[] colNo,
int startIndex,
int endIndex)
sortData in interface DataProvider
public void sortData(java.lang.String[] colName,
boolean[] order,
int startIndex,
int endIndex)
sortData in interface DataProvidercolName - the names of the columnsstartIndex - the index of the record from which the sorting is startedendIndex - the index of the record upto which the sorting is doneorder - the sorting criteria for related columns, default all true
public void sortData(int[] colNo,
boolean[] order,
int fromIndex,
int toIndex)
sortData in interface DataProvidercolNo - the indices of the columnsorder - the sorting criteria for related columns, default all truefromIndex - the index of the record from which the sorting is startedtoIndex - the index of the record upto which the sorting is donepublic int find(java.lang.String condition)
public int find(java.lang.String condition,
int startIndex,
int endIndex)
find in interface DataProvidercondition - the seraching criteriastartIndex - the index of the record from which the searching is started, default 0endIndex - the index of the record upto which the searching is done, default total number of records
public int findNext()
findNext in interface DataProviderpublic int getModifiedCount()
public int getFilteredCount()
public int getDeletedCount()
public boolean rollbackModifications()
public boolean saveModifications()
public void addDataListener(DataListener l)
public void removeDataListener(DataListener l)
protected void dataChanged(int id,
int oldIndex,
int currentIndex)
oldIndex - the index has been viewedcurrentIndex - the index to be viewed
protected void dataChanged(int id,
java.util.Vector oldVect,
java.util.Vector newVect)
oldVect - the old row data
public void fireDataChanged(int eventId,
java.util.Hashtable oldValue,
java.util.Hashtable newValue)
eventId - the data event idoldValue - the old data valuesnewValue - the new (changed) data valuespublic void setDataProvider(DataProvider dataProvider)
dataProvider - the data providerpublic DataProvider getDataProvider()
public void setSortCriteria(java.lang.String sort)
setSortCriteria in interface DataProvidersort - the sort criteriapublic java.lang.String getSortCriteria()
getSortCriteria in interface DataProviderpublic java.util.Vector getSortColumns()
getSortColumns in interface DataProviderpublic void setFilterCriteria(java.lang.String filter)
setFilterCriteria in interface DataProviderfilter - the filter criteriapublic java.lang.String getFilterCriteria()
getFilterCriteria in interface DataProviderpublic void setAppendDataOnFetchNext(boolean b)
setAppendDataOnFetchNext in interface DataProviderb - true to append the next fetched data, false to replacepublic boolean isAppendDataOnFetchNext()
isAppendDataOnFetchNext in interface DataProviderpublic void setFetchSize(int size)
setFetchSize in interface DataProvidersize - the total number of records that can be fetched by invoking getData()public int getFetchSize()
getFetchSize in interface DataProviderpublic void setSkippedRows(int n)
setSkippedRows in interface DataProvidern - the number of rows to be skipped while retrievingpublic int getSkippedRows()
getSkippedRows in interface DataProvider
public void rankData(int groupIndex,
java.util.Vector groupBands)
rankData in interface DataProvidergroupIndex - the group indexgroupBands - the group information
public static boolean equals(java.lang.Object obj1,
java.lang.Object obj2)
obj1 - the object of any data typeobj2 - the object of any data type
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
A PropertyChangeEvent will get fired in response to an explicit setFont, setBackground, or SetForeground on the current component. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property. If listener is null, no exception is thrown and no action is performed.
listener - the PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the PropertyChangeListener to be removed
protected void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundException
|
ElegantJCharts Java API Specification v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||