ElegantJCharts Java API Specification v2.0

com.elegantj.data.dataprovider
Class AbstractDataProvider

java.lang.Object
  |
  +--com.elegantj.data.dataprovider.AbstractDataProvider
All Implemented Interfaces:
DataProvider, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
SqlDataProvider, TextDataProvider

public abstract class AbstractDataProvider
extends java.lang.Object
implements DataProvider, java.io.Externalizable

This class encapsulates functionality of a abstract data provider. Subclass should override the retrieve() and save() methods.

See Also:
Serialized Form

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

currentIndex

protected transient int currentIndex
Specifies the current index


dataTable

protected transient Table dataTable
Specifies the actual text data


clientTable

protected transient Table clientTable
Specifies the text data that user can use for transaction


columnNames

protected transient java.util.Vector columnNames
Specifies the vector containing the column names


changes

protected transient java.beans.PropertyChangeSupport changes
Specifies the PropertyChangeSupport object used to support the bound properties


c11

public transient com.elegantj.editors.C11 c11
Constructor Detail

AbstractDataProvider

public AbstractDataProvider()
Method Detail

setLicenseKey

public void setLicenseKey(java.lang.String key)
Sets the license key

Parameters:
key - the license key

getLicenseKey

public java.lang.String getLicenseKey()
Gets the license key

Returns:
the license key

setRowSeparator

public void setRowSeparator(java.lang.String rowSep)
Sets the row separator to export data in text format.

Parameters:
rowSep - the row separator to export data in text format.

getRowSeparator

public java.lang.String getRowSeparator()
Gets the row separator to export data in text format.

Returns:
the row separator to export data in text format.

setColumnSeparator

public void setColumnSeparator(java.lang.String colSep)
Sets the column separator to export data in text format.

Parameters:
colSep - the column separator to export data in text format.

getColumnSeparator

public java.lang.String getColumnSeparator()
Gets the column separator to export data in text format.

Returns:
the column separator to export data in text format.

setTextQualifier

public void setTextQualifier(java.lang.String qualifier)
Sets the text qualifier to export data in text format.

Parameters:
qualifier - the text qualifier to export data in text format.

getTextQualifier

public java.lang.String getTextQualifier()
Gets the text qualifier to export data in text format.

Returns:
the text qualifier to export data in text format.

setFirstRowAsColumnNames

public void setFirstRowAsColumnNames(boolean b)
Sets whether the first row contains the column names or not

Parameters:
b - true to consider the first row as column names

isFirstRowAsColumnNames

public boolean isFirstRowAsColumnNames()
Gets whether the first row contains the column names or not

Returns:
true if the first row as column names, otherwise false

setColumnsDelimited

public void setColumnsDelimited(boolean b)
Sets whether the column values are delimited or fixed width

Parameters:
b - true to consider the column values are delimited, otherwise fixed width

isColumnsDelimited

public boolean isColumnsDelimited()
Gets whether the column values are delimited or fixed width

Returns:
true if the column values are delimited, otherwise false

setColumnsWidth

public void setColumnsWidth(java.lang.String widths)
Sets the width of each column if the column values are fixed width

Parameters:
widths - the string contains comma separated value for column width

getColumnsWidth

public java.lang.String getColumnsWidth()
Gets the width of each column if the column values are fixed width

Returns:
the string contains comma separated value for column width

exportToText

public void exportToText(java.io.OutputStream out)
                  throws java.io.IOException
java.io.IOException

exportToText

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
Exports the data in text format to the given output stream. Columns are separated by any character(s).

java.io.IOException

exportToText

public void exportToText(java.io.OutputStream out,
                         java.lang.String rowSeparator,
                         boolean firstRowAsColumnNames,
                         java.lang.String columnsWidth)
                  throws java.io.IOException
Exports the data in text format to the given output stream. Each column has fixed number of characters.

java.io.IOException

exportToText

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
Exports the data in text format to the given output stream, it takes the default value for the null or empty argument

Parameters:
out - the Output stream in which the data will be pushed
rowSeparator - the string which separates each row
firstRowAsColumnNames - true if first row contains the column names
columnsDelimited - true if each columns are separated by any character(s)
columnSeparator - the string which separates each column
textQualifier - the string which identifies the string portion
columnsWidth - the string which represents each column's width as comma separated values
java.io.IOException

parseInt

public static int[] parseInt(java.lang.String str)
Parses the comma separated integer values from the given string


setRootTag

public void setRootTag(java.lang.String rootTag)
Sets the root tag to export the data in xml format

Parameters:
rootTag - the xml tag to represent the root

getRootTag

public java.lang.String getRootTag()
Gets the root tag to export the data in xml format

Returns:
the xml tag to represent the root

setRowTag

public void setRowTag(java.lang.String rowTag)
Sets the row tag to export the data in xml format

Parameters:
rowTag - the xml tag to represent the row

getRowTag

public java.lang.String getRowTag()
Gets the row tag to export the data in xml format

Returns:
the xml tag to represent the row

setColumnTag

public void setColumnTag(java.lang.String columnTag)
Sets the column tag to export the data in xml format

Parameters:
columnTag - the xml tag to represent the column

getColumnTag

public java.lang.String getColumnTag()
Gets the column tag to export the data in xml format

Returns:
the xml tag to represent the column

exportToXML

public void exportToXML(java.io.OutputStream out)
                 throws java.io.IOException
java.io.IOException

exportToXML

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
Exports the data in xml format to the given output stream, it takes the default value for the null or empty argument

Parameters:
out - the Output stream in which the data will be pushed
rootTag - the xml tag to represent the root
rowTag - the xml tag to represent the row
columnTag - the xml tag to represent the column
firstRowAsColumnNames - true if first row contains the column names
java.io.IOException

exportToSQL

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

exportToSQL

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
Exports the data in the given database table

Parameters:
url - the database url, as an example
driver - the name of the database driver class
user - the name of the database user
password - the password relative to given user
tableName - the name of database table
tableColumns - 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

exportToSQL

public void exportToSQL(java.sql.Connection conn,
                        java.lang.String tableName)
                 throws java.sql.SQLException
java.sql.SQLException

exportToSQL

public void exportToSQL(java.sql.Connection conn,
                        java.lang.String tableName,
                        java.lang.String[] tableColumns)
                 throws java.sql.SQLException
Exports the data in the given database table

Parameters:
conn - the database connection
tableName - the name of database table
tableColumns - 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.SQLException

addRow

public void addRow(java.util.Vector vector)
Adds the record

Parameters:
vector - the values of the record

deleteRow

public void deleteRow()
Deletes the record


firstRecord

public java.util.Vector firstRecord()
Moves to the first record and returns it

Specified by:
firstRecord in interface DataProvider
Returns:
the vector contains the first record

lastRecord

public java.util.Vector lastRecord()
Moves to the last record and returns it

Specified by:
lastRecord in interface DataProvider
Returns:
the vector contains the last record

nextRecord

public java.util.Vector nextRecord()
Moves to the next record and returns it

Specified by:
nextRecord in interface DataProvider
Returns:
the vector contains the next record

previousRecord

public java.util.Vector previousRecord()
Moves to the previous record and returns it

Specified by:
previousRecord in interface DataProvider
Returns:
the vector contains the previous record

scrollToRow

public java.util.Vector scrollToRow(int record)
Moves to the record at the specified index and returns it

Specified by:
scrollToRow in interface DataProvider
Parameters:
record - the record index to be scrolled
Returns:
the vector contains the record at the specified index

refreshData

public void refreshData()
Refreshes the fetched data.

Specified by:
refreshData in interface DataProvider

getData

public java.util.Vector getData()
Fetches the data

Specified by:
getData in interface DataProvider
Returns:
the vector contains the data

getDataAt

public java.util.Vector getDataAt(int rowPosition)
Returns the record at the specified position

Specified by:
getDataAt in interface DataProvider
Returns:
the vector contains the record

getDataAt

public java.lang.Object getDataAt(int rowPosition,
                                  int columnPosition)
Returns the data value at the specified rowPosition and sepecified columnPosition

Specified by:
getDataAt in interface DataProvider
Parameters:
rowPosition - the position of the row
columnPosition - the position of the column
Returns:
the data value

getDataCount

public int getDataCount()
Returns the total number of records

Specified by:
getDataCount in interface DataProvider
Returns:
the total number of records

appendData

public int appendData(java.util.Vector data)
Appends the data

Parameters:
data - the vector contains the record
Returns:
the position of the data

insertDataAt

public int insertDataAt(java.util.Vector data,
                        int pos)
Inserts the data at the specified position

Parameters:
data - the vector contains the record
Returns:
the position of the data

modifyDataAt

public void modifyDataAt(java.util.Vector data,
                         int pos)
Modifies the data at specified position

Parameters:
data - the vector contains the record

setData

public void setData(java.util.Vector data)
Sets the data

Parameters:
data - the two dimension vector contains the data

setDataArray

public void setDataArray(java.util.Vector[] arrayData)
Sets the data

Parameters:
arrayData - the array of the vector contains the data

removeAll

public void removeAll()
Removes all the records


removeAt

public void removeAt(int position)
Removes the record at specified position

Parameters:
position - the position of the data to be removed

removeRange

public void removeRange(int startPos,
                        int endPos)
Removes the records between start position to end position

Parameters:
startPos - the start position of the data
endPos - the from position of the data

getColumnCount

public int getColumnCount()
Returns the total number of columns

Specified by:
getColumnCount in interface DataProvider
Returns:
the total number of columns

getColumnNames

public java.util.Vector getColumnNames()
Returns the column names

Specified by:
getColumnNames in interface DataProvider
Returns:
the vector contains the column names

getColumnsArray

public java.lang.String[] getColumnsArray()
Returns the column names

Specified by:
getColumnsArray in interface DataProvider
Returns:
the array of the the column names

getColumnIndex

public int getColumnIndex(java.lang.String columnName)
Returns the index of the column colName

Specified by:
getColumnIndex in interface DataProvider
Parameters:
columnName - the name of the column
Returns:
the index of the column

getColumnType

public int getColumnType(int colIndex)
Returns the type of the column at the specified index

Specified by:
getColumnType in interface DataProvider
Parameters:
colIndex - the index of the column
Returns:
the column type

getCurrentIndex

public int getCurrentIndex()
Returns the current index

Specified by:
getCurrentIndex in interface DataProvider
Returns:
the index of the record ,being proccessed

getCurrentRecord

public java.util.Vector getCurrentRecord()
Returns the current record

Specified by:
getCurrentRecord in interface DataProvider
Returns:
the record ,being proccessed

getComputable

public Computable getComputable()
Gets the Computable object which is used for filtering, searching and other computation operation

Specified by:
getComputable in interface DataProvider
Returns:
the Computable object

setFilterState

public void setFilterState(boolean filterFlag)
Sets the filtering enability

Specified by:
setFilterState in interface DataProvider
Parameters:
filterFlag - true, if the filtering is enabled

isFilterState

public boolean isFilterState()
Gets the filtering enability

Specified by:
isFilterState in interface DataProvider
Returns:
true, if the filtering is enabled, otherwise false

setSaveOnlyFilteredData

public void setSaveOnlyFilteredData(boolean b)
Sets the save operation criteria

Parameters:
b - true to save only filtered data, false to save all data

isSaveOnlyFilteredData

public boolean isSaveOnlyFilteredData()
Gets the save operation criteria

Returns:
true if only filtered data can be saved, otherwise false

filterData

public void filterData(java.lang.String filter)
Filters the data with specified criteria

Specified by:
filterData in interface DataProvider
Parameters:
filter - the criteria to be processed to filter the data

sortData

public void sortData(java.util.Vector sortColumns)
Sorts the data with specified columns

Parameters:
sortColumns - the two dimensional vector contains the column name and its sorting order as each element

sortData

public void sortData(java.lang.String[] colName)
Specified by:
sortData in interface DataProvider

sortData

public void sortData(int[] colNo)
Specified by:
sortData in interface DataProvider

sortData

public void sortData(java.lang.String[] colName,
                     boolean[] order)
Specified by:
sortData in interface DataProvider

sortData

public void sortData(int[] colNo,
                     boolean[] order)
Specified by:
sortData in interface DataProvider

sortData

public void sortData(java.lang.String[] colName,
                     int startIndex,
                     int endIndex)
Specified by:
sortData in interface DataProvider

sortData

public void sortData(int[] colNo,
                     int startIndex,
                     int endIndex)
Specified by:
sortData in interface DataProvider

sortData

public 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

Specified by:
sortData in interface DataProvider
Parameters:
colName - the names of the columns
startIndex - the index of the record from which the sorting is started
endIndex - the index of the record upto which the sorting is done
order - the sorting criteria for related columns, default all true

sortData

public void sortData(int[] colNo,
                     boolean[] order,
                     int fromIndex,
                     int toIndex)
Sorts the data for specified columns at column indices with specified sorting order and

Specified by:
sortData in interface DataProvider
Parameters:
colNo - the indices of the columns
order - the sorting criteria for related columns, default all true
fromIndex - the index of the record from which the sorting is started
toIndex - the index of the record upto which the sorting is done

find

public int find(java.lang.String condition)

find

public 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

Specified by:
find in interface DataProvider
Parameters:
condition - the seraching criteria
startIndex - the index of the record from which the searching is started, default 0
endIndex - the index of the record upto which the searching is done, default total number of records
Returns:
the index of the searched record

findNext

public int findNext()
Returns the index of the record which satisfied the condition after invoking the find()

Specified by:
findNext in interface DataProvider
Returns:
the index of the searched record

getModifiedCount

public int getModifiedCount()
Returns the total number of the records has been modified

Returns:
the total number of the modified records

getFilteredCount

public int getFilteredCount()
Returns the total number of the records has been filtered

Returns:
the total number of the filtered records

getDeletedCount

public int getDeletedCount()
Returns the total number of the records has been deleted

Returns:
the total number of the deleted records

rollbackModifications

public boolean rollbackModifications()
Rolls back the modifications

Returns:
true if the rolls back process has been done, otherwise false

saveModifications

public boolean saveModifications()
Saves the modifications

Returns:
true if the saving process has been done, otherwise false

addDataListener

public void addDataListener(DataListener l)
Adds a DataListener


removeDataListener

public void removeDataListener(DataListener l)
Removes a DataListener


dataChanged

protected void dataChanged(int id,
                           int oldIndex,
                           int currentIndex)
Fires the data event when the data has been changed

Parameters:
oldIndex - the index has been viewed
currentIndex - the index to be viewed

dataChanged

protected void dataChanged(int id,
                           java.util.Vector oldVect,
                           java.util.Vector newVect)
Fires the data event when the data has been changed

Parameters:
oldVect - the old row data

fireDataChanged

public void fireDataChanged(int eventId,
                            java.util.Hashtable oldValue,
                            java.util.Hashtable newValue)
Invokes this method when the data has been changed

Parameters:
eventId - the data event id
oldValue - the old data values
newValue - the new (changed) data values

setDataProvider

public void setDataProvider(DataProvider dataProvider)
Sets the data provider

Parameters:
dataProvider - the data provider

getDataProvider

public DataProvider getDataProvider()
Gets the data Provider

Returns:
the data provider

setSortCriteria

public 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

Specified by:
setSortCriteria in interface DataProvider
Parameters:
sort - the sort criteria

getSortCriteria

public java.lang.String getSortCriteria()
Gets the criteria for sorting the data

Specified by:
getSortCriteria in interface DataProvider
Returns:
the sort criteria

getSortColumns

public java.util.Vector getSortColumns()
Returns the two dimensional vector containing the sort column name and its sorting order as each element

Specified by:
getSortColumns in interface DataProvider
Returns:
the vector containing the sorted columns

setFilterCriteria

public void setFilterCriteria(java.lang.String filter)
Sets the criteria for filtering the data, the criteria is any expression (arithmetical/database related),

Specified by:
setFilterCriteria in interface DataProvider
Parameters:
filter - the filter criteria

getFilterCriteria

public java.lang.String getFilterCriteria()
Gets the criteria for filtering the data

Specified by:
getFilterCriteria in interface DataProvider
Returns:
the filter criteria

setAppendDataOnFetchNext

public void setAppendDataOnFetchNext(boolean b)
Sets whether the next fetched data is appended or replaced to the existing data

Specified by:
setAppendDataOnFetchNext in interface DataProvider
Parameters:
b - true to append the next fetched data, false to replace

isAppendDataOnFetchNext

public boolean isAppendDataOnFetchNext()
Returns whether the next fetched data is appended or replaced to the existing data

Specified by:
isAppendDataOnFetchNext in interface DataProvider
Returns:
true to append the next fetched data, false to replace

setFetchSize

public void setFetchSize(int size)
Sets the fetch size

Specified by:
setFetchSize in interface DataProvider
Parameters:
size - the total number of records that can be fetched by invoking getData()

getFetchSize

public int getFetchSize()
Gets the fetch size

Specified by:
getFetchSize in interface DataProvider
Returns:
the fetch size

setSkippedRows

public void setSkippedRows(int n)
Sets the total number of rows to be skipped while retrieving

Specified by:
setSkippedRows in interface DataProvider
Parameters:
n - the number of rows to be skipped while retrieving

getSkippedRows

public int getSkippedRows()
Gets the total number of rows to be skipped while retrieving

Specified by:
getSkippedRows in interface DataProvider
Returns:
the number of rows to be skipped while retrieving

rankData

public void rankData(int groupIndex,
                     java.util.Vector groupBands)
Generate rank data based on given group information

Specified by:
rankData in interface DataProvider
Parameters:
groupIndex - the group index
groupBands - the group information

equals

public static boolean equals(java.lang.Object obj1,
                             java.lang.Object obj2)
Checks whether the specified objects are equals or not

Parameters:
obj1 - the object of any data type
obj2 - the object of any data type
Returns:
true if obj1 equals to obj2, otherwise false

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

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.

Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed

firePropertyChange

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.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalizable interface implementation to save and retrieve the state of this bean

Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.