Type - Indicates the type of the instances in the result set.Closeable, AutoCloseablepublic class FetchResult<Type> extends Object implements Closeable
AlbumList or AlbumListInfo instances, and provides
methods to get an instance at a specified position in the FetchResult instance.SystemCapability.Multimedia#MEDIA_LIBRARY| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static String |
MEDIA_TYPE_ALBUM_LIST |
Indicates that this
FetchResult instance contains AlbumList instances. |
static String |
MEDIA_TYPE_ALBUM_LIST_INFO |
Indicates that this
FetchResult instance contains AlbumListInfo instances. |
| 构造器 | 说明 |
|---|---|
FetchResult(Context callerContext,
ResultSet resultSet,
String type) |
A constructor used to create a
FetchResult instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
close() |
Closes this stream and releases any system resources associated
with it.
|
int |
getCount() |
Obtains the number of
AlbumList or AlbumListInfo instances contained in this FetchResult
instance. |
Type |
getFirstObject() |
Obtains the first instance in this
FetchResult instance. |
Type |
getLastObject() |
Obtains the last instance in this
FetchResult instance. |
Type |
getNextObject() |
Obtains the next instance in this
FetchResult instance. |
Type |
getPositionObject(int index) |
Obtains an instance at a specified position in this
FetchResult instance. |
boolean |
isClosed() |
Checks whether this
FetchResult instance is closed. |
boolean |
isContain() |
Obtains whether this
FetchResult instance contains either AlbumList or AlbumListInfo
instances. |
public static final String MEDIA_TYPE_ALBUM_LIST
FetchResult instance contains AlbumList instances.public FetchResult(Context callerContext, ResultSet resultSet, String type)
FetchResult instance.callerContext - Indicates the application context.resultSet - Indicates the result set from which information is fetched.type - Indicates the type of the result to fetch, which can be MEDIA_TYPE_ALBUM_LIST or
MEDIA_TYPE_ALBUM_LIST_INFO.public void close()
Closeable As noted in AutoCloseable#close(), cases where the
close may fail require careful attention. It is strongly advised
to relinquish the underlying resources and to internally
mark the Closeable as closed, prior to throwing
the IOException.
close 在接口中 AutoCloseableclose 在接口中 Closeablepublic boolean isContain()
FetchResult instance contains either AlbumList or AlbumListInfo
instances.true if this FetchResult instance contains instances of either types; returns
false otherwise.public int getCount()
AlbumList or AlbumListInfo instances contained in this FetchResult
instance.FetchResult instance.public boolean isClosed()
FetchResult instance is closed.true if this FetchResult instance is closed; returns false
otherwise.public Type getPositionObject(int index)
FetchResult instance.index - Indicates the instance index.public Type getFirstObject()
FetchResult instance.public Type getNextObject()
FetchResult instance.public Type getLastObject()
FetchResult instance.