public abstract static class CacheStrategy.AbstractBasicSymmetricalCacheStrategy extends Object implements CacheStrategy
This simple approach rules out more advanced heuristics that would take the current scrolling direction or past scrolling behavior into account.
CacheStrategy.AbstractBasicSymmetricalCacheStrategy, CacheStrategy.DefaultCacheStrategy| Constructor and Description |
|---|
AbstractBasicSymmetricalCacheStrategy() |
| Modifier and Type | Method and Description |
|---|---|
Range |
getMaxCacheRange(Range displayedRange,
Range cachedRange,
Range estimatedAvailableRange)
Gets the maximum row range that should be cached.
|
abstract int |
getMaximumCacheSize(int pageSize)
Gets the maximum number of extra items to cache in one direction.
|
Range |
getMinCacheRange(Range displayedRange,
Range cachedRange,
Range estimatedAvailableRange)
Gets the minimum row range that should be cached.
|
abstract int |
getMinimumCacheSize(int pageSize)
Gets the the minimum number of extra items to cache in one direction.
|
void |
onDataArrive(double roundTripTime,
int rowCount)
Called whenever data requested by the data source has arrived.
|
public AbstractBasicSymmetricalCacheStrategy()
public void onDataArrive(double roundTripTime,
int rowCount)
CacheStrategyA cache strategy implementation cannot use this information to keep track of which items are in the cache since the data source might discard items without notifying the cache strategy.
onDataArrive in interface CacheStrategyroundTripTime - the total number of milliseconds elapsed from requesting the
data until the response was passed to the data sourcerowCount - the number of received rowspublic Range getMinCacheRange(Range displayedRange, Range cachedRange, Range estimatedAvailableRange)
CacheStrategygetMinCacheRange in interface CacheStrategydisplayedRange - the range of currently displayed rowscachedRange - the range of currently cached rowsestimatedAvailableRange - the estimated range of rows available for the data sourcepublic Range getMaxCacheRange(Range displayedRange, Range cachedRange, Range estimatedAvailableRange)
CacheStrategygetMaxCacheRange in interface CacheStrategydisplayedRange - the range of currently displayed rowscachedRange - the range of currently cached rowsestimatedAvailableRange - the estimated range of rows available for the data sourcepublic abstract int getMaximumCacheSize(int pageSize)
pageSize - the current number of items used at oncepublic abstract int getMinimumCacheSize(int pageSize)
pageSize - the current number of items used at onceCopyright © 2023 Vaadin Ltd. All rights reserved.