|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--planetj.database.RowCollection
|
+--planetj.database.filter.FilteredRowCollection
A FilteredRowCollection is returned by the RowCollection.filter() method. It contains a subset of the rows
which its parent contains. A FilteredRowCollection can be connected, in which case rows added to or
removed from it will also be added to or removed from its parent, and rows added to or removed from its parent
will be added to or removed from it (if they are naturally part of its subset).
Neither of these actions will happen if a RowCollection is disconnected. Once disconnected, a RowCollection
cannot be reconnected to its parent.
When a row is added to a FilteredRowCollection, the row is only added if it meets the filter's criteria
(it may be added to the parent even if it didn't meet the criteria for this RowCollection).
Currently, when a row in a FilteredRowCollection is altered, it is NOT rechecked to see if it still meets
the criteria. (A Row altered in a FilteredRowCollection is also altered in its parent, since they are
the same Row.)
| Nested Class Summary |
| Nested classes inherited from class planetj.database.RowCollection |
RowCollection.LinkedRowCollection |
| Field Summary |
| Fields inherited from class planetj.database.RowCollection |
className, FIRST_ROW, LAST_ROW |
| Constructor Summary | |
FilteredRowCollection()
|
|
| Method Summary | |
void |
addRow(int index,
Row row)
Inserts the specified row at the specified position in this list (optional operation). |
void |
disconnect()
Disconnects this RowCollection from its parent. |
IFilter |
getFilter()
Gets the filter used to create this FilteredRowCollection |
Object |
getKey()
Gets the filter used to create this FilteredRowCollection |
RowCollection |
getParent()
Gets the RowCollection from which this FilteredRowCollection was created |
Object |
getValue()
Returns this same FilteredRowCollection |
boolean |
isConnected()
Tests if this RowCollection is connected to its parent |
void |
refilter()
Clears this RowCollection and then reruns the filter, adding rows from the parent as appropriate |
boolean |
removeRow(Row row)
Removes the row from this RowCollection. |
void |
setFilter(IFilter newFilter)
Sets the filter used to create this FilteredRowCollection. |
void |
setParent(RowCollection newParent)
Sets the parent of this FilteredRowCollection. |
Row |
setRow(int index,
Row row)
Replaces the row at the specified position in this list with the specified row, if the Row meets the filter criteria. |
RowCollection |
sort(String[] pColumnNames,
String pSortOrder)
Sorts the Rows in this RowCollection. If this RowCollection contains all rows from its database table, then we can do an internal sort. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
equals, hashCode |
| Constructor Detail |
public FilteredRowCollection()
| Method Detail |
public void addRow(int index,
Row row)
addRow in class RowCollectionindex - index at which the specified row is to be inserted.row - the row to be inserted.
UnsupportedOperationException - if the add method is not
supported by this list.
ClassCastException - if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException - if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException - if the index is out of range
(index < 0 || index > size()).public void disconnect()
public IFilter getFilter()
public Object getKey()
public final RowCollection getParent()
public Object getValue()
public boolean isConnected()
public void refilter()
public boolean removeRow(Row row)
removeRow in class RowCollectionrow - The row to remove.
public void setFilter(IFilter newFilter)
public void setParent(RowCollection newParent)
public Row setRow(int index,
Row row)
Replaces the row at the specified position in this list with the specified row, if the Row meets the filter criteria. This replacement is propigated to all connected RowCollections. If the Row doesen't meet the filter criteria, then the Row currently at the specified index is removed from this RowCollection; the removed Row will also be removed from all connected RowCollections and possibly replaced with the specified Row (depending on whether the connected RowCollections accept the specified Row).
Note that in the connected RowCollections, this replacement is keyed by the Row that was replaced, not the index of the replaced Row.
setRow in class RowCollectionindex - index of row to replace.row - the row to be stored at the specified position.
UnsupportedOperationException - if the set method is not
supported by this list.
ClassCastException - if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException - if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException - if the index is out of range
(index < 0 || index >= size()).
public RowCollection sort(String[] pColumnNames,
String pSortOrder)
throws CMException
If this RowCollection has (Next or Previous) more rows in the database to read, then this RowCollection's parent is sorted with its sort() method, and then that RowCollection is used to produce a new FilteredRowCollection to return (using this RowCollection's filter).
sort in class RowCollectionpColumnNames - String[] that represents the an array of column names in the order
at which they should be sorted by
(i.e. sort by pColumnName[0] then sort by pColumn[1] etc...)pSortOrder - String constant either ASC or DESC for sorting in ascending or descending order
CMException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||