@UnstableApi
class CacheSpan : Comparable


Defines a span of data that may or may not be cached (as indicated by isCached).

Summary

Public constructors

CacheSpan(key: String!, position: Long, length: Long)

Creates a hole CacheSpan which isn't cached, has no last touch timestamp and no file associated.

CacheSpan(
    key: String!,
    position: Long,
    length: Long,
    lastTouchTimestamp: Long,
    file: File?
)

Creates a CacheSpan.

Public functions

Int
compareTo(another: CacheSpan!)
Boolean

Returns whether this is a hole CacheSpan.

Boolean

Returns whether this is an open-ended CacheSpan.

String!

Public properties

File?

The file corresponding to this CacheSpan, or null if isCached is false.

Boolean

Whether the CacheSpan is cached.

String!

The cache key that uniquely identifies the resource.

Long

The last touch timestamp, or TIME_UNSET if isCached is false.

Long

The length of the CacheSpan, or LENGTH_UNSET if this is an open-ended hole.

Long

The position of the CacheSpan in the resource.

Public constructors

CacheSpan

CacheSpan(key: String!, position: Long, length: Long)

Creates a hole CacheSpan which isn't cached, has no last touch timestamp and no file associated.

Parameters
key: String!

The cache key that uniquely identifies the resource.

position: Long

The position of the CacheSpan in the resource.

length: Long

The length of the CacheSpan, or LENGTH_UNSET if this is an open-ended hole.

CacheSpan

CacheSpan(
    key: String!,
    position: Long,
    length: Long,
    lastTouchTimestamp: Long,
    file: File?
)

Creates a CacheSpan.

Parameters
key: String!

The cache key that uniquely identifies the resource.

position: Long

The position of the CacheSpan in the resource.

length: Long

The length of the CacheSpan, or LENGTH_UNSET if this is an open-ended hole.

lastTouchTimestamp: Long

The last touch timestamp, or TIME_UNSET if isCached is false.

file: File?

The file corresponding to this CacheSpan, or null if it's a hole.

Public functions

compareTo

fun compareTo(another: CacheSpan!): Int

isHoleSpan

fun isHoleSpan(): Boolean

Returns whether this is a hole CacheSpan.

isOpenEnded

fun isOpenEnded(): Boolean

Returns whether this is an open-ended CacheSpan.

toString

fun toString(): String!

Public properties

file

val fileFile?

The file corresponding to this CacheSpan, or null if isCached is false.

isCached

val isCachedBoolean

Whether the CacheSpan is cached.

key

val keyString!

The cache key that uniquely identifies the resource.

lastTouchTimestamp

val lastTouchTimestampLong

The last touch timestamp, or TIME_UNSET if isCached is false.

length

val lengthLong

The length of the CacheSpan, or LENGTH_UNSET if this is an open-ended hole.

position

val positionLong

The position of the CacheSpan in the resource.