ElegantJ Data Tables Java API Specification v1.1

com.elegantj.data.dataprovider
Interface DataProvider

All Known Implementing Classes:
AbstractDataProvider

public interface DataProvider

The DataProvider interface for objects which provides the data and the transaction.


Method Summary
 void addDataListener(DataListener listener)
          Adds a DataListener
 void addRow(java.util.Vector vector)
          Adds the record
 int appendData(java.util.Vector data)
          Appends the data
 void deleteRow()
          Deletes the record
 void filterData(java.lang.String filterCriteria)
          Fiters 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
 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 colName)
          Returns the index of the column colName
 java.util.Vector getColumnNames()
          Returns the column names
 java.lang.String[] getColumnsArray()
          Returns the column names
 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 position)
          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
 int getDeletedCount()
          Returns the total number of the records has been deleted
 int getFetchSize()
          Gets the total number of records that can be fetched by getData() method call
 java.lang.String getFilterCriteria()
          Gets the criteria for filtering the data
 int getFilteredCount()
          Returns the total number of the records has been filtered
 int getModifiedCount()
          Returns the total number of the records has been modified
 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
 int insertDataAt(java.util.Vector data, int position)
          Inserts the data at the specified position
 boolean isAppendDataOnFetchNext()
          Returns whether the next fetched data is appended or replaced to the existing data
 boolean isFetchNext()
          Determines whether fetching the next rows or not
 boolean isFilterState()
          Gets the filtering enability
 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 position)
          Modifies the data at specified position
 boolean nextData()
          If more data can be fetched, it fetches and return true, otherwise return false
 java.util.Vector nextRecord()
          Moves to the next record and returns it
 java.util.Vector previousRecord()
          Moves to the previous record and returns it
 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 listener)
          Removes a DataListener
 void removeRange(int startPos, int endPos)
          Removes the records between start position to end position
 void retrieve()
          Retrives the data
 boolean rollbackModifications()
          Rolls back the modifications
 void save()
          Saves the transaction
 boolean saveModifications()
          Saves the modifications
 java.util.Vector scrollToRow(int index)
          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 setData(java.util.Vector data)
          Sets the data
 void setDataArray(java.util.Vector[] arrayData)
          Sets the data
 void setFetchSize(int size)
          Sets the total number of records that can be fetched by getData() method call
 void setFilterCriteria(java.lang.String filter)
          Sets the criteria for filtering the data, the criteria is any expression (arithmetical/database related),
 void setFilterState(boolean filterState)
          Sets the filtering enability
 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 sortCriteria)
          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 sortData(int[] colIndex)
           
 void sortData(int[] colIndex, boolean[] ordering)
           
 void sortData(int[] colIndex, boolean[] ordering, int startIndex, int endIndex)
          Sorts the data for specified columns at column indices with specified sorting order and range of the records
 void sortData(int[] colIndex, int startIndex, int endIndex)
           
 void sortData(java.lang.String[] colName)
           
 void sortData(java.lang.String[] colName, boolean[] ordering)
           
 void sortData(java.lang.String[] colName, boolean[] ordering, 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)
           
 

Method Detail

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


save

public void save()
Saves the transaction


firstRecord

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

Returns:
the vector contains the first record

lastRecord

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

Returns:
the vector contains the last record

nextRecord

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

Returns:
the vector contains the next record

previousRecord

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

Returns:
the vector contains the previous record

scrollToRow

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

Parameters:
index - the record index to be scrolled
Returns:
the vector contains the record at the specified index

refreshData

public void refreshData()
Refreshes the fetched data.


nextData

public boolean nextData()
If more data can be fetched, it fetches and return true, otherwise return false

Returns:
true, if the data has been fetched, otherwise false

getData

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

Returns:
the vector contains the data

getDataAt

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

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

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

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 position)
Inserts the data at the specified position

Parameters:
data - the vector contains the record
position - the position of the data to be inserted
Returns:
the position of the data

modifyDataAt

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

Parameters:
data - the vector contains the record
position - the position of the data to be modified

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

Returns:
the total number of columns

getColumnNames

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

Returns:
the vector contains the column names

getColumnsArray

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

Returns:
the array of the the column names

getColumnIndex

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

Parameters:
colName - 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

Parameters:
colIndex - the index of the column
Returns:
the column type

getCurrentIndex

public int getCurrentIndex()
Returns the current index

Returns:
the index of the record ,being proccessed

getCurrentRecord

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

Returns:
the record ,being proccessed

retrieve

public void retrieve()
Retrives the data


getComputable

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

Returns:
the Computable object

setAppendDataOnFetchNext

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

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

Returns:
true to append the next fetched data, false to replace

setSkippedRows

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

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

Returns:
the number of rows to be skipped while retrieving

setFetchSize

public void setFetchSize(int size)
Sets the total number of records that can be fetched by getData() method call

Parameters:
size - the total number of records that can be fetched

getFetchSize

public int getFetchSize()
Gets the total number of records that can be fetched by getData() method call

Returns:
the total number of records that can be fetched

isFetchNext

public boolean isFetchNext()
Determines whether fetching the next rows or not

Returns:
true if fetching the next rows

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

setFilterState

public void setFilterState(boolean filterState)
Sets the filtering enability

Parameters:
filterState - true, if the filtering is enabled

isFilterState

public boolean isFilterState()
Gets the filtering enability

Returns:
true, if the filtering is enabled, otherwise false

setFilterCriteria

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

Parameters:
filter - the filter criteria

getFilterCriteria

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

Returns:
the filter criteria

filterData

public void filterData(java.lang.String filterCriteria)
Fiters the data with specified criteria

Parameters:
filterCriteria - the criteria to be processed to filter the data

setSortCriteria

public void setSortCriteria(java.lang.String sortCriteria)
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

Parameters:
sortCriteria - the sort criteria

getSortCriteria

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

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

Returns:
the vector containing the sorted columns

sortData

public void sortData(int[] colIndex)

sortData

public void sortData(java.lang.String[] colName)

sortData

public void sortData(int[] colIndex,
                     boolean[] ordering)

sortData

public void sortData(java.lang.String[] colName,
                     boolean[] ordering)

sortData

public void sortData(int[] colIndex,
                     int startIndex,
                     int endIndex)

sortData

public void sortData(java.lang.String[] colName,
                     int startIndex,
                     int endIndex)

sortData

public void sortData(int[] colIndex,
                     boolean[] ordering,
                     int startIndex,
                     int endIndex)
Sorts the data for specified columns at column indices with specified sorting order and range of the records

Parameters:
colIndex - the indices of the columns
ordering - the sorting criteria for related columns, default all true
startIndex - the index of the record from which the sorting is started
endIndex - the index of the record upto which the sorting is done

sortData

public void sortData(java.lang.String[] colName,
                     boolean[] ordering,
                     int startIndex,
                     int endIndex)
Sorts the data for specified columns with specified sorting order and range of the records

Parameters:
colName - the names of the columns
ordering - the sorting criteria for related columns, default all true
startIndex - the index of the record from which the sorting is started
endIndex - 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

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()

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 listener)
Adds a DataListener

Parameters:
listener - the DataListener to be added

removeDataListener

public void removeDataListener(DataListener listener)
Removes a DataListener

Parameters:
listener - the DataListener to be removed

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

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

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