public class RequestBatch extends AbstractList<Request>
| Modifier and Type | Class and Description |
|---|---|
static interface |
RequestBatch.Callback
Specifies the interface that consumers of the RequestBatch class can implement in order to be notified when the
entire batch completes execution.
|
modCount| Constructor and Description |
|---|
RequestBatch()
Constructor.
|
RequestBatch(Collection<Request> requests)
Constructor.
|
RequestBatch(Request... requests)
Constructor.
|
RequestBatch(RequestBatch requests)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int location,
Request request) |
boolean |
add(Request request) |
void |
addCallback(RequestBatch.Callback callback)
Adds a batch-level callback which will be called when the entire batch has finished executing.
|
void |
clear() |
List<Response> |
executeAndWait()
Executes this batch on the current thread and returns the responses.
|
RequestAsyncTask |
executeAsync()
Executes this batch asynchronously.
|
Request |
get(int i) |
int |
getTimeout()
Gets the timeout to wait for responses from the server before a timeout error occurs.
|
Request |
remove(int location) |
void |
removeCallback(RequestBatch.Callback callback)
Removes a batch-level callback.
|
Request |
set(int location,
Request request) |
void |
setTimeout(int timeoutInMilliseconds)
Sets the timeout to wait for responses from the server before a timeout error occurs.
|
int |
size() |
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringpublic RequestBatch()
public RequestBatch(Collection<Request> requests)
requests - the requests to add to the batchpublic RequestBatch(Request... requests)
requests - the requests to add to the batchpublic RequestBatch(RequestBatch requests)
requests - the requests to add to the batchpublic int getTimeout()
public void setTimeout(int timeoutInMilliseconds)
timeoutInMilliseconds - the timeout, in milliseconds; 0 means do not timeoutpublic void addCallback(RequestBatch.Callback callback)
callback - the callbackpublic void removeCallback(RequestBatch.Callback callback)
callback - the callbackpublic final boolean add(Request request)
add in interface Collection<Request>add in interface List<Request>add in class AbstractList<Request>public final void add(int location,
Request request)
public final void clear()
clear in interface Collection<Request>clear in interface List<Request>clear in class AbstractList<Request>public final Request get(int i)
public final Request remove(int location)
public final int size()
size in interface Collection<Request>size in interface List<Request>size in class AbstractCollection<Request>public final List<Response> executeAndWait()
FacebookException - If there was an error in the protocol used to communicate with the serviceIllegalArgumentException - if the passed in RequestBatch is emptyNullPointerException - if the passed in RequestBatch or any of its contents are nullpublic final RequestAsyncTask executeAsync()
Request.setCallback(com.facebook.Request.Callback))
This should only be called from the UI thread.IllegalArgumentException - if this batch is emptyNullPointerException - if any of the contents of this batch are nullCopyright © 2013. All Rights Reserved.