Interface DownloadIndex
-
- All Known Subinterfaces:
WritableDownloadIndex
- All Known Implementing Classes:
DefaultDownloadIndex
@WorkerThread public interface DownloadIndex
An index ofDownloads
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Download
getDownload(String id)
Returns theDownload
with the givenid
, or null.DownloadCursor
getDownloads(int... states)
-
-
-
Method Detail
-
getDownload
@Nullable Download getDownload(String id) throws IOException
Returns theDownload
with the givenid
, or null.This method may be slow and shouldn't normally be called on the main thread.
- Parameters:
id
- ID of aDownload
.- Returns:
- The
Download
with the givenid
, or null if a download state with this id doesn't exist. - Throws:
IOException
- If an error occurs reading the state.
-
getDownloads
DownloadCursor getDownloads(@State int... states) throws IOException
Returns aDownloadCursor
toDownload
s with the givenstates
.This method may be slow and shouldn't normally be called on the main thread.
- Parameters:
states
- Returns only theDownload
s with this states. If empty, returns all.- Returns:
- A cursor to
Download
s with the givenstates
. - Throws:
IOException
- If an error occurs reading the state.
-
-