|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
com.elj.data.dataprovider.text.TextDataProvider
This class encapsulates functionality of a text data provider.
It provides data in a format in which the row separator is new line
character, and the column separator is user-specified character.
And the first line contains the column names.
e.g.: The example with column separator ',' is as follows:
colName1,colName2,colName3
d11,d12,d13
d21,d22,d23
| Field Summary | |
protected java.beans.PropertyChangeSupport |
changes
|
static java.lang.String |
DEFAULT_COLUMN_SEPARATOR
|
| Constructor Summary | |
TextDataProvider()
Constructs an empty text data provider with no. |
|
| Method Summary | |
void |
addDataListener(com.elj.data.dataprovider.text.DataListener listener)
Not implemented. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
|
void |
addRow(java.util.Vector vector)
Method which adds a record to the end of existing records. |
int |
appendData(java.util.Vector rec)
Method which appends the record at the end of existing records. |
void |
deleteRow()
Method which deletes the current record. |
void |
filterData(java.lang.String filterCriteria)
Not implemented. |
int |
find(java.lang.String condition,
int startIndex,
int endIndex)
Not implemented. |
int |
findNext()
Not implemented. |
void |
fireDataChanged(int eventId,
java.util.Hashtable oldValue,
java.util.Hashtable newValue)
Not implemented. |
java.util.Vector |
firstRecord()
Method which returns the first record. |
int |
getColumnCount()
Method which returns the column count. |
int |
getColumnIndex(java.lang.String colName)
Method which returns index of specified column name. |
java.util.Vector |
getColumnNames()
Method which returns the vector of column names. |
java.lang.String[] |
getColumnsArray()
|
java.lang.String |
getColumnSeparator()
Method which returns the column separator for this text data provider. |
int |
getColumnType(int colIndex)
Method which returns type of specified column index. |
int |
getCurrentIndex()
Method which returns the current cursor position. |
java.util.Vector |
getCurrentRecord()
Method which retrieves current record. |
java.util.Vector |
getData()
Method which returns the data vector. |
java.util.Vector |
getDataAt(int recordIndex)
Method which returns the record at specified index. |
java.lang.Object |
getDataAt(int recordIndex,
int columnIndex)
Method which returns the data at specified record and column index. |
int |
getDataCount()
Method which returns total number of records. |
com.elj.data.dataprovider.text.DataProvider |
getDataProvider()
|
int |
getDeletedCount()
Not implemented. |
int |
getFilteredCount()
Not implemented. |
int |
getModifiedCount()
Not implemented. |
int |
getTableCount()
Not implemented. |
java.util.Vector |
getTableNames()
Not implemented. |
int |
insertDataAt(java.util.Vector rec,
int position)
Method which inserts specified record at specified position. |
boolean |
isFilterState()
Not implemented. |
java.util.Vector |
lastRecord()
Method which returns the last record. |
void |
modifyDataAt(java.util.Vector data,
int position)
Method which modifies the record at specified position with specified data. |
boolean |
nextData()
Not implemented. |
java.util.Vector |
nextRecord()
Method which returns the next record with respect to current cursor position. |
java.util.Vector |
previousRecord()
Method which returns the previous record with respect to current cursor position. |
void |
readExternal(java.io.ObjectInput in)
|
void |
refreshData()
Not implemented. |
void |
removeAll()
Method which removes all records. |
void |
removeAt(int position)
Method which removes a record from specified position. |
void |
removeDataListener(com.elj.data.dataprovider.text.DataListener listener)
Not implemented. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
|
void |
removeRange(int startPos,
int endPos)
Method which removes a range of records. |
void |
retrieve()
Not implemented. |
void |
retrieve(java.lang.String[] args)
Not implemented. |
void |
retrieveData(java.io.InputStream is)
Method which retrieves the data from any input stream. |
boolean |
rollbackModifications()
Not implemented. |
void |
save()
Not implemented. |
void |
saveData(java.io.OutputStream os)
Method which saves the data of this text data provider to any output stream. |
boolean |
saveModifications()
Not implemented. |
java.util.Vector |
scrollToRow(int index)
Method which scrolls the current cursor position at the specified index. |
void |
setColumnNames(java.util.Vector columnVector)
Method which sets the column names for this text data provider. |
void |
setColumnSeparator(java.lang.String colSep)
Method which sets the column separator for this text data provider. |
void |
setCurrentIndex(int pos)
Method which sets the current cursor position. |
void |
setData(java.util.Vector data)
Method which set the data for this text data provider. |
void |
setDataArray(java.util.Vector[] arrayData)
Method which copies the records of this text data provider into specified array. |
void |
setDataProvider(com.elj.data.dataprovider.text.DataProvider dp)
|
void |
setFilterState(boolean filterState)
Not implemented. |
void |
sortData(int[] colIndex)
|
void |
sortData(int[] colIndex,
boolean[] ordering)
Method which sorts the data. |
void |
sortData(int[] colIndex,
boolean[] ordering,
int startIndex,
int endIndex)
Method which sorts the data in a specified range. |
void |
sortData(int[] colIndex,
int startIndex,
int endIndex)
|
void |
sortData(java.lang.String[] colName)
|
void |
sortData(java.lang.String[] colName,
boolean[] ordering)
Method which sorts the data. |
void |
sortData(java.lang.String[] colName,
boolean[] ordering,
int startIndex,
int endIndex)
Method which sorts the data in a specified range. |
void |
sortData(java.lang.String[] colName,
int startIndex,
int endIndex)
|
void |
undo()
Not implemented. |
void |
writeExternal(java.io.ObjectOutput out)
|
| Field Detail |
protected java.beans.PropertyChangeSupport changes
public static java.lang.String DEFAULT_COLUMN_SEPARATOR
| Constructor Detail |
public TextDataProvider()
| Method Detail |
public void retrieveData(java.io.InputStream is)
is - The input stream from which to retrieve the data.public void saveData(java.io.OutputStream os)
os - The output stream to save the data to.public void addRow(java.util.Vector vector)
vector - The vector which contains the record data.public void deleteRow()
vector - The vector which contains the record data.public void save()
public void undo()
public java.util.Vector firstRecord()
public java.util.Vector lastRecord()
public java.util.Vector nextRecord()
public java.util.Vector previousRecord()
public java.util.Vector scrollToRow(int index)
index - The index at which to scroll current cursor position.public void refreshData()
public boolean nextData()
public java.util.Vector getData()
public java.util.Vector getDataAt(int recordIndex)
recordIndex - The index of the record to be retrieved.
public java.lang.Object getDataAt(int recordIndex,
int columnIndex)
recordIndex - The index of the record.columnIndex - The index of column for specified record index.public int getDataCount()
public int appendData(java.util.Vector rec)
public int insertDataAt(java.util.Vector rec,
int position)
rec - The vector containing the record data.position - The position at which to insert the record.
public void modifyDataAt(java.util.Vector data,
int position)
data - The vector containing the record data.position - The position of the record to be modified.public void setData(java.util.Vector data)
data - The vector containing the vectors of records.public void setDataArray(java.util.Vector[] arrayData)
arrayData - The array of vector into which the records will be copied.public void removeAll()
public void removeAt(int position)
position - The position from which to remove a record.
public void removeRange(int startPos,
int endPos)
startPos - The start position.endPos - The end position.public int getTableCount()
public java.util.Vector getTableNames()
public int getColumnCount()
public java.util.Vector getColumnNames()
public void setColumnNames(java.util.Vector columnVector)
columnVector - The vector of column names.public int getColumnIndex(java.lang.String colName)
colName - The column name whose index is to be returned.public int getColumnType(int colIndex)
colIndex - The column index whose type is to be returned.public int getCurrentIndex()
public void setCurrentIndex(int pos)
pos - The position to be set as current cursor position.public java.util.Vector getCurrentRecord()
public void retrieve()
public void retrieve(java.lang.String[] args)
public void setFilterState(boolean filterState)
public boolean isFilterState()
public void sortData(int[] colIndex)
public void sortData(java.lang.String[] colName)
public void sortData(int[] colIndex,
boolean[] ordering)
colIndex - The array containing indexes of columns to be sorted.ordering - The array containing the order of sorting.
public void sortData(java.lang.String[] colName,
boolean[] ordering)
colName - The array containing names of columns to be sorted.ordering - The array containing the order of sorting.
public void sortData(int[] colIndex,
int startIndex,
int endIndex)
public void sortData(int[] colIndex,
boolean[] ordering,
int startIndex,
int endIndex)
colIndex - The array containing indexes of columns to be sorted.ordering - The array containing the order of sorting.startIndex - The start index.endIndex - The end index
public void sortData(java.lang.String[] colName,
int startIndex,
int endIndex)
public void sortData(java.lang.String[] colName,
boolean[] ordering,
int startIndex,
int endIndex)
colName - The array containing names of columns to be sorted.ordering - The array containing the order of sorting.startIndex - The start index.endIndex - The end indexpublic void filterData(java.lang.String filterCriteria)
public int find(java.lang.String condition,
int startIndex,
int endIndex)
public int findNext()
public int getModifiedCount()
public int getFilteredCount()
public int getDeletedCount()
public boolean rollbackModifications()
public boolean saveModifications()
public java.lang.String[] getColumnsArray()
public void addDataListener(com.elj.data.dataprovider.text.DataListener listener)
public void removeDataListener(com.elj.data.dataprovider.text.DataListener listener)
public void fireDataChanged(int eventId,
java.util.Hashtable oldValue,
java.util.Hashtable newValue)
public void setColumnSeparator(java.lang.String colSep)
colSep - The column separator for this text data provider.public java.lang.String getColumnSeparator()
public void setDataProvider(com.elj.data.dataprovider.text.DataProvider dp)
public com.elj.data.dataprovider.text.DataProvider getDataProvider()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizable
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||