Interface Request
-
- All Known Implementing Classes:
ErrorRequestCoordinator,SingleRequest,ThumbnailRequestCoordinator
public interface RequestA request that loads a resource for anTarget.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbegin()Starts an asynchronous load.voidclear()Prevents any bitmaps being loaded from previous requests, releases any resources held by this request, displays the current placeholder if one was provided, and marks the request as having been cancelled.booleanisAnyResourceSet()Returns true if a resource is set, even if the request is not yet complete or the primary request has failed.booleanisCleared()Returns true if the request has been cleared.booleanisComplete()Returns true if the request has completed successfully.booleanisEquivalentTo(Request other)booleanisRunning()Returns true if this request is running and has not completed or failed.voidpause()Similar toclear()for in progress requests (or portions of a request), but does nothing if the request is already complete.
-
-
-
Method Detail
-
begin
void begin()
Starts an asynchronous load.
-
clear
void clear()
Prevents any bitmaps being loaded from previous requests, releases any resources held by this request, displays the current placeholder if one was provided, and marks the request as having been cancelled.
-
pause
void pause()
Similar toclear()for in progress requests (or portions of a request), but does nothing if the request is already complete.Unlike
clear(), this method allows implementations to act differently on subparts of a request. For example if a Request has both a thumbnail and a primary request and the thumbnail portion of the request is complete, this method allows only the primary portion of the request to be paused without clearing the previously completed thumbnail portion.
-
isRunning
boolean isRunning()
Returns true if this request is running and has not completed or failed.
-
isComplete
boolean isComplete()
Returns true if the request has completed successfully.
-
isCleared
boolean isCleared()
Returns true if the request has been cleared.
-
isAnyResourceSet
boolean isAnyResourceSet()
Returns true if a resource is set, even if the request is not yet complete or the primary request has failed.
-
isEquivalentTo
boolean isEquivalentTo(Request other)
Returnstrueif thisRequestis equivalent to the givenRequest(has all of the same options and sizes).This method is identical to
Object.equals(Object)except that it's specific toRequestsubclasses. We do not useObject.equals(Object)directly because we trackRequests in collections likeSetand it's perfectly legitimate to have two differentRequestobjects for two differentTargets (for example). Using a similar but different method let's us selectively compareRequestobjects to each other when it's useful in specific scenarios.
-
-