|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LocalRowKeyIndex
Defines a set of "local" APIs for a CollectionModel. The "local" APIs allow a client to query the model and determine if a set of rows are locally available. "Locally available" can mean the model has the given set of rows in a local cache and can honor a fetch request efficiently (for example, without performing a SQL query).
| Nested Class Summary | |
|---|---|
static class |
LocalRowKeyIndex.Confidence
Enum used in the getEstimatedRowCountConfidence() API to determine
if the row count is exact or an estimate |
static class |
LocalRowKeyIndex.LocalCachingStrategy
Enum used to indicate the type of caching supported by the model |
| Method Summary | |
|---|---|
boolean |
areRowsLocallyAvailable(int rowCount)
Check if a range of rows is locally available starting from the current row |
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 |
int |
getEstimatedRowCount()
Convenient API to return a row count estimate. |
LocalRowKeyIndex.Confidence |
getEstimatedRowCountConfidence()
Helper API to determine if the row count returned from getEstimatedRowCount()
is EXACT, or an ESTIMATE |
boolean |
isRowLocallyAvailable(int rowIndex)
Given a row index, check if a row is locally available |
boolean |
isRowLocallyAvailable(Object rowKey)
Given a row key, check if a row is locally available |
| Method Detail |
|---|
boolean isRowLocallyAvailable(int rowIndex)
rowIndex - index of row to check
true if row is locally available flase otherwiseboolean isRowLocallyAvailable(Object rowKey)
rowKey - row key for the row to check
true if row is locally available flase otherwise
boolean areRowsLocallyAvailable(int startIndex,
int rowCount)
startIndex - staring index for the rangerowCount - number of rows in the range
true if range of rows is locally available flase otherwise
boolean areRowsLocallyAvailable(Object startRowKey,
int rowCount)
startRowKey - staring row key for the rangerowCount - number of rows in the range
true if range of rows is locally available flase otherwiseboolean areRowsLocallyAvailable(int rowCount)
rowCount - number of rows in the range
true if range of rows is locally available flase otherwiseint getEstimatedRowCount()
This method can return -1 or a row count estimate if determining
exact row count requires a data fetch. When dealing with estimated row counts,
the caller needs to gracefully handle the case where isRowAvailable
returns false for a row index or a row key.
LocalRowKeyIndex.Confidence getEstimatedRowCountConfidence()
getEstimatedRowCount()
is EXACT, or an ESTIMATE
void clearLocalCache()
void clearCachedRows(int startingIndex,
int rowsToClear)
startingIndex - starting row index for the range to clearrowsToClear - number of rows to clear from the cache
void clearCachedRows(Object startingRowKey,
int rowsToClear)
startingRowKey - starting row key for the range to clearrowsToClear - number of rows to clear from the cachevoid clearCachedRow(int index)
index - row index for the row to clear from the cachevoid clearCachedRow(Object rowKey)
rowKey - row key for the row to clear from the cacheLocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
LocalRowKeyIndex.LocalCachingStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||