docs/doc/reference/com/google/android/exoplayer2/upstream/cache/CacheSpan.html
Package com.google.android.exoplayer2.upstream.cache
All Implemented Interfaces:Comparable<CacheSpan>
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classCacheSpanextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Comparable](https://developer.android.com/reference/java/lang/Comparable.html "class or interface in java.lang")<[CacheSpan](CacheSpan.html "class 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.
Defines a span of data that may or may not be cached (as indicated by isCached).
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| File | file |
Deprecated.
The file corresponding to this CacheSpan, or null if isCached is false.
|
| boolean | isCached |
Deprecated.
Whether the CacheSpan is cached.
|
| String | key |
Deprecated.
The cache key that uniquely identifies the resource.
|
| long | lastTouchTimestamp |
Deprecated.
The last touch timestamp, or C.TIME_UNSET if isCached is false.
|
| long | length |
Deprecated.
The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
|
| long | position |
Deprecated.
The position of the CacheSpan in the resource.
|
Constructors | Constructor | Description |
| --- | --- |
| CacheSpan(String key, long position, long length) |
Deprecated.
Creates a hole CacheSpan which isn't cached, has no last touch timestamp and no file associated.
|
| CacheSpan(String key, long position, long length, long lastTouchTimestamp, File file) |
Deprecated.
Creates a CacheSpan. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| int | compareTo(CacheSpan another) |
Deprecated.
|
| boolean | isHoleSpan() |
Deprecated.
Returns whether this is a hole CacheSpan.
|
| boolean | isOpenEnded() |
Deprecated.
Returns whether this is an open-ended CacheSpan.
|
| String | toString() |
Deprecated.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key
Deprecated.
The cache key that uniquely identifies the resource.
-
public final long position
Deprecated.
The position of the CacheSpan in the resource.
-
public final long length
Deprecated.
The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
-
public final boolean isCached
Deprecated.
Whether the CacheSpan is cached.
-
@Nullable
public final[File](https://developer.android.com/reference/java/io/File.html "class or interface in java.io")file
Deprecated.
The file corresponding to this CacheSpan, or null if isCached is false.
-
public final long lastTouchTimestamp
Deprecated.
The last touch timestamp, or C.TIME_UNSET if isCached is false.
-
public CacheSpan([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
long position,
long length)
Deprecated.
Creates a hole CacheSpan which isn't cached, has no last touch timestamp and no file associated.
Parameters:key - The cache key that uniquely identifies the resource.position - The position of the CacheSpan in the resource.length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.
-
public CacheSpan([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")key,
long position,
long length,
long lastTouchTimestamp,
@Nullable[File](https://developer.android.com/reference/java/io/File.html "class or interface in java.io")file)
Deprecated.
Creates a CacheSpan.
Parameters:key - The cache key that uniquely identifies the resource.position - The position of the CacheSpan in the resource.length - The length of the CacheSpan, or C.LENGTH_UNSET if this is an open-ended hole.lastTouchTimestamp - The last touch timestamp, or C.TIME_UNSET if isCached is false.file - The file corresponding to this CacheSpan, or null if it's a hole.
-
public boolean isOpenEnded()
Deprecated.
Returns whether this is an open-ended CacheSpan.
-
public boolean isHoleSpan()
Deprecated.
Returns whether this is a hole CacheSpan.
-
public int compareTo([CacheSpan](CacheSpan.html "class in com.google.android.exoplayer2.upstream.cache")another)
Deprecated.
Specified by:compareTo in interface Comparable<CacheSpan>
-
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()
Deprecated.
Overrides:toString in class Object