Package com.castlabs.sdk.thumbs
Class ThumbnailLoadQueue
- java.lang.Object
-
- com.castlabs.sdk.thumbs.ThumbnailLoadQueue
-
public class ThumbnailLoadQueue extends Object
Holder of bothThumbnailRequestandThumbnailEntryLoadqueues. It's mandatory that all method calls which modify the queues to be synchronized externally.
-
-
Constructor Summary
Constructors Constructor Description ThumbnailLoadQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequest(com.castlabs.sdk.thumbs.ThumbnailRequest request)Adds aThumbnailRequestto the queuevoidclearAll()Clear all queuesvoidclearRequests(boolean invokeCallbacks)Clears all pending requestsbooleanisEmpty()com.castlabs.sdk.thumbs.ThumbnailLoadpop()Returns the nextThumbnailLoadto load.voidreplaceEntriesQueue(Collection<com.castlabs.sdk.thumbs.ThumbnailEntryLoad> entriesToLoad)Clears the queue ofThumbnailEntryLoadand replaces it with the given collection
-
-
-
Method Detail
-
replaceEntriesQueue
public void replaceEntriesQueue(Collection<com.castlabs.sdk.thumbs.ThumbnailEntryLoad> entriesToLoad)
Clears the queue ofThumbnailEntryLoadand replaces it with the given collection- Parameters:
entriesToLoad- the collection of entry loads to enqueue
-
addRequest
public void addRequest(com.castlabs.sdk.thumbs.ThumbnailRequest request)
Adds aThumbnailRequestto the queue- Parameters:
request- the request to add to the queue
-
clearRequests
public void clearRequests(boolean invokeCallbacks)
Clears all pending requests- Parameters:
invokeCallbacks- whether to invoke the callbacks on the removed requests
-
clearAll
public void clearAll()
Clear all queues
-
isEmpty
public boolean isEmpty()
- Returns:
- true if both of the underlying queues are empty
-
pop
@Nullable public com.castlabs.sdk.thumbs.ThumbnailLoad pop()
Returns the nextThumbnailLoadto load. This might be a Request or an Entry Load. If the request queue is not empty, it will be prioritized.- Returns:
- the
ThumbnailLoadto load next.
-
-