public abstract class CollectionModelDecorator extends CollectionModel
Used by anybody who wants to wrap the CollectionModel class.
This class simply delegates all the CollectionModel functionalities to the wrapped class.
The wrapped CollectionModel is returned by thegetCollectionModel method. And that
method needs to be overriden by the subclasses.getCollectionModel()LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy| Constructor and Description |
|---|
CollectionModelDecorator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataModelListener(javax.faces.model.DataModelListener listener) |
boolean |
areRowsAvailable(int rowCount)
Check if a range of rows is available starting from the
current row.
|
boolean |
areRowsAvailable(int startIndex,
int rowCount)
Check if a range of rows is available from a starting index.
|
boolean |
areRowsAvailable(Object startRowKey,
int rowCount)
Check if a range of rows is available from a starting row key
This method makes the row with the given row key current and calls
#areRowsAvailable(rowsToCheck). |
boolean |
areRowsLocallyAvailable(int rowCount)
Check if a range of rows is locally available starting from current position.
|
boolean |
areRowsLocallyAvailable(int startIndex,
int rowCount)
Check if a range of rows is locally available starting from a row index.
|
boolean |
areRowsLocallyAvailable(Object startRowKey,
int rowCount)
Check if a range of rows is locally available starting from a row key.
|
void |
clearCachedRow(int index)
Clear a row from the local cache by row index
|
void |
clearCachedRow(Object rowKey)
Clear a row from the local cache by row key
|
void |
clearCachedRows(int startingIndex,
int rowsToClear)
Clear the requested range of rows from the local cache
|
void |
clearCachedRows(Object startingRowKey,
int rowsToClear)
Clear the requested range of rows from the local cache
|
void |
clearLocalCache()
clear all rows from the local cache
|
LocalRowKeyIndex.LocalCachingStrategy |
getCachingStrategy()
Indicates the caching strategy supported by the model
|
protected abstract CollectionModel |
getCollectionModel()
This method returns the wrapped
CollectionModel. |
javax.faces.model.DataModelListener[] |
getDataModelListeners() |
int |
getEstimatedRowCount()
Convenient API to return a row count estimate.
|
LocalRowKeyIndex.Confidence |
getEstimatedRowCountConfidence()
Helper API to determine if the row count returned from
CollectionModel.getEstimatedRowCount()
is EXACT, or an ESTIMATE. |
int |
getRowCount()
Gets the number of values in this collection
|
Object |
getRowData()
Gets the current value identified by the current index or rowKey.
|
Object |
getRowData(int rowIndex)
Gets the rowData at the given index.
|
Object |
getRowData(Object rowKey)
Returns the rowData for the given rowKey without changing model currency.
|
int |
getRowIndex()
Gets the index of the current value.
|
Object |
getRowKey()
Gets the rowKey of the current row.
|
List<SortCriterion> |
getSortCriteria()
Gets the criteria that this collection is sorted by.
|
Object |
getWrappedData() |
boolean |
isRowAvailable()
Checks to make sure a value exists for the current index or rowKey.
|
boolean |
isRowAvailable(int rowIndex)
Checks to see if the row at the given index is available.
|
boolean |
isRowAvailable(Object rowKey)
Check for an available row by row key.
|
boolean |
isRowLocallyAvailable(int rowIndex)
Given a row index, check if the row is locally available.
|
boolean |
isRowLocallyAvailable(Object rowKey)
Given a row key, check if the row is locally available.
|
boolean |
isSortable(String property)
Return true if this collection is sortable by the given property.
|
void |
removeDataModelListener(javax.faces.model.DataModelListener listener) |
void |
setRowIndex(int i)
Sets up a value at a particular index to be the current value.
|
void |
setRowKey(Object key)
Finds the row with the matching key and makes it current
|
void |
setSortCriteria(List<SortCriterion> criteria)
Sorts this collection by the given criteria.
|
void |
setWrappedData(Object object) |
addRowKeyChangeListener, fireRowKeyChange, removeRowKeyChangeListenerpublic Object getRowKey()
CollectionModelObject.equals(java.lang.Object) and Object.hashCode() as they will be used
as keys in hashtables. rowKeys should also be Serializable, so that the
application can run under all JSF state-saving schemes.getRowKey in interface RowKeyIndexgetRowKey in class CollectionModelCollectionModel.setRowKey(java.lang.Object)public void setRowKey(Object key)
CollectionModelsetRowKey in interface RowKeyIndexsetRowKey in class CollectionModelkey - the rowKey, previously obtained from CollectionModel.getRowKey().public boolean isRowAvailable(int rowIndex)
CollectionModelDataModel.isRowAvailable().
Finally, the row that was current before this method was called
is made current again.isRowAvailable in interface RowKeyIndexisRowAvailable in class CollectionModelrowIndex - the index of the row to check.DataModel.isRowAvailable()public boolean isRowAvailable(Object rowKey)
CollectionModelDataModel.isRowAvailable().
Finally, the row that was current before this method was called
is made current again.isRowAvailable in interface RowKeyIndexisRowAvailable in class CollectionModelrowKey - the row key for the row to check.DataModel.isRowAvailable()public Object getRowData(int rowIndex)
CollectionModelDataModel.getRowData().
Finally, the row that was current before this method was called
is made current again.getRowData in interface RowKeyIndexgetRowData in class CollectionModelrowIndex - the index of the row to get data from.DataModel.getRowData()public Object getRowData(Object rowKey)
CollectionModelgetRowData in interface RowKeyIndexgetRowData in class CollectionModelrowKey - the row key of the row to get data from.DataModel.getRowData()public boolean isSortable(String property)
CollectionModelisSortable in class CollectionModelpublic List<SortCriterion> getSortCriteria()
CollectionModelgetSortCriteria in class CollectionModelSortCriterionpublic void setSortCriteria(List<SortCriterion> criteria)
CollectionModelsetSortCriteria in class CollectionModelcriteria - Each element in this List must be of type SortCriterion.
The empty list may be used to cancel any sort order. null should be treated
the same as an empty list.SortCriterionpublic boolean areRowsAvailable(int startIndex,
int rowCount)
CollectionModelareRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelstartIndex - the starting index for the rangerowCount - number of rows to check. If rowsToCheck < 0 set
startIndex = startIndex - abs(rowsToCheck) + 1. This
allows for checking for row availability from the end position. For example
to check for availability of n rows from the end, call
isRangeAvailable(getRowCount()-1, -n)falsepublic boolean areRowsAvailable(Object startRowKey, int rowCount)
CollectionModel#areRowsAvailable(rowsToCheck).
The current row does not change after this callareRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelstartRowKey - the starting row key for the rangerowCount - number of rows to checkCollectionModel.areRowsAvailable(int).public boolean areRowsAvailable(int rowCount)
CollectionModelareRowsAvailable in interface RowKeyIndexareRowsAvailable in class CollectionModelrowCount - number of rows to checkpublic boolean areRowsLocallyAvailable(int startIndex,
int rowCount)
CollectionModelareRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelstartIndex - starting row index to checkrowCount - number of rows to checkfalseCollectionModel.areRowsAvailable(int, int)public boolean areRowsLocallyAvailable(Object startRowKey, int rowCount)
CollectionModelareRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelstartRowKey - starting row key to checkrowCount - number of rows to checkfalseCollectionModel.areRowsAvailable(Object, int)public boolean areRowsLocallyAvailable(int rowCount)
CollectionModelareRowsLocallyAvailable(startIndex, rowsToCheck)areRowsLocallyAvailable in interface LocalRowKeyIndexareRowsLocallyAvailable in class CollectionModelrowCount - number of rows to checkfalseareRowsLocallyAvailable(startIndex, rowsToCheck)public boolean isRowLocallyAvailable(int rowIndex)
CollectionModelisRowLocallyAvailable in interface LocalRowKeyIndexisRowLocallyAvailable in class CollectionModelrowIndex - row index to checkfalsepublic boolean isRowLocallyAvailable(Object rowKey)
CollectionModelisRowLocallyAvailable in interface LocalRowKeyIndexisRowLocallyAvailable in class CollectionModelrowKey - row key to checkfalsepublic int getEstimatedRowCount()
CollectionModelgetEstimatedRowCount in interface LocalRowKeyIndexgetEstimatedRowCount in class CollectionModelDataModel.getRowCount()public LocalRowKeyIndex.Confidence getEstimatedRowCountConfidence()
CollectionModelCollectionModel.getEstimatedRowCount()
is EXACT, or an ESTIMATE.getEstimatedRowCountConfidence in interface LocalRowKeyIndexgetEstimatedRowCountConfidence in class CollectionModelDataModel.getRowCount()public void clearLocalCache()
clearLocalCache in interface LocalRowKeyIndexclearLocalCache in class CollectionModelpublic void clearCachedRows(int startingIndex,
int rowsToClear)
clearCachedRows in interface LocalRowKeyIndexclearCachedRows in class CollectionModelstartingIndex - starting row index for the range to clearrowsToClear - number of rows to clear from the cacheCollectionModel.clearLocalCache()public void clearCachedRows(Object startingRowKey, int rowsToClear)
clearCachedRows in interface LocalRowKeyIndexclearCachedRows in class CollectionModelstartingRowKey - starting row key for the range to clearrowsToClear - number of rows to clear from the cacheCollectionModel.clearLocalCache()public void clearCachedRow(int index)
clearCachedRow in interface LocalRowKeyIndexclearCachedRow in class CollectionModelindex - row index for the row to clear from the cacheCollectionModel.clearCachedRows(int, int)public void clearCachedRow(Object rowKey)
clearCachedRow in interface LocalRowKeyIndexclearCachedRow in class CollectionModelrowKey - row key for the row to clear from the cacheCollectionModel.clearCachedRows(Object, int)public LocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
getCachingStrategy in interface LocalRowKeyIndexgetCachingStrategy in class CollectionModelLocalCachingStrategypublic boolean isRowAvailable()
RowKeyIndexRowKeyIndex.getRowCount()).isRowAvailable in interface RowKeyIndexisRowAvailable in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public int getRowCount()
RowKeyIndexgetRowCount in interface RowKeyIndexgetRowCount in class javax.faces.model.DataModelpublic Object getRowData()
RowKeyIndexgetRowData in interface RowKeyIndexgetRowData in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public int getRowIndex()
RowKeyIndexgetRowIndex in interface RowKeyIndexgetRowIndex in class javax.faces.model.DataModelpublic void setRowIndex(int i)
RowKeyIndexsetRowIndex in interface RowKeyIndexsetRowIndex in class javax.faces.model.DataModeli - the zero-based index of the value to make current.
Use -1 to clear the current valuepublic Object getWrappedData()
getWrappedData in class javax.faces.model.DataModelpublic void setWrappedData(Object object)
setWrappedData in class javax.faces.model.DataModelpublic void addDataModelListener(javax.faces.model.DataModelListener listener)
addDataModelListener in class javax.faces.model.DataModelpublic javax.faces.model.DataModelListener[] getDataModelListeners()
getDataModelListeners in class javax.faces.model.DataModelpublic void removeDataModelListener(javax.faces.model.DataModelListener listener)
removeDataModelListener in class javax.faces.model.DataModelprotected abstract CollectionModel getCollectionModel()
CollectionModel.Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.