docs/doc/reference/com/google/android/exoplayer2/upstream/cache/CacheEvictor.html
Package com.google.android.exoplayer2.upstream.cache
Cache.ListenerAll Known Implementing Classes:LeastRecentlyUsedCacheEvictor, NoOpCacheEvictor[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceCacheEvictorextends[Cache.Listener](Cache.Listener.html "interface in com.google.android.exoplayer2.upstream.cache")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Evicts data from a Cache. Implementations should call Cache.removeSpan(CacheSpan) to evict cache entries based on their eviction policies.
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | onCacheInitialized() |
Deprecated.
Called when cache has been initialized.
|
| void | onStartFile(Cache cache, String key, long position, long length) |
Deprecated.
Called when a writer starts writing to the cache.
|
| boolean | requiresCacheSpanTouches() |
Deprecated.
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them.
|
-
onSpanAdded, onSpanRemoved, onSpanTouched
-
boolean requiresCacheSpanTouches()
Deprecated.
Returns whether the evictor requires the Cache to touch CacheSpans when it accesses them. Implementations that do not use CacheSpan.lastTouchTimestamp should return false.
-
void onCacheInitialized()
Deprecated.
Called when cache has been initialized.
-
void onStartFile([Cache](Cache.html "interface in com.google.android.exoplayer2.upstream.cache")cache,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
long position,
long length)
Deprecated.
Called when a writer starts writing to the cache.
Parameters:cache - The source of the event.key - The key being written.position - The starting position of the data being written.length - The length of the data being written, or C.LENGTH_UNSET if unknown.