public class GraphRequestBatch extends java.util.AbstractList<GraphRequest>
| Modifier and Type | Class and Description |
|---|---|
static interface |
GraphRequestBatch.Callback
Specifies the interface that consumers of the RequestBatch class can implement in order to be
notified when the entire batch completes execution.
|
static interface |
GraphRequestBatch.OnProgressCallback
Specifies the interface that consumers of the RequestBatch class can implement in order to be
notified when the batch makes progress.
|
| Constructor and Description |
|---|
GraphRequestBatch()
Constructor.
|
GraphRequestBatch(java.util.Collection<GraphRequest> requests)
Constructor.
|
GraphRequestBatch(GraphRequest... requests)
Constructor.
|
GraphRequestBatch(GraphRequestBatch requests)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(GraphRequest request) |
void |
add(int location,
GraphRequest request) |
void |
addCallback(GraphRequestBatch.Callback callback)
Adds a batch-level callback which will be called when the entire batch has finished
executing.
|
void |
clear() |
java.util.List<GraphResponse> |
executeAndWait()
Executes this batch on the current thread and returns the responses.
|
GraphRequestAsyncTask |
executeAsync()
Executes this batch asynchronously.
|
GraphRequest |
get(int i) |
java.lang.String |
getBatchApplicationId()
Getter for the batch application id.
|
int |
getTimeout()
Gets the timeout to wait for responses from the server before a timeout error occurs.
|
GraphRequest |
remove(int location) |
void |
removeCallback(GraphRequestBatch.Callback callback)
Removes a batch-level callback.
|
GraphRequest |
set(int location,
GraphRequest request) |
void |
setBatchApplicationId(java.lang.String batchApplicationId)
Setter for the batch application id.
|
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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic GraphRequestBatch()
public GraphRequestBatch(java.util.Collection<GraphRequest> requests)
requests - the requests to add to the batchpublic GraphRequestBatch(GraphRequest... requests)
requests - the requests to add to the batchpublic GraphRequestBatch(GraphRequestBatch 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(GraphRequestBatch.Callback callback)
callback - the callbackpublic void removeCallback(GraphRequestBatch.Callback callback)
callback - the callbackpublic final boolean add(GraphRequest request)
add in interface java.util.Collection<GraphRequest>add in interface java.util.List<GraphRequest>add in class java.util.AbstractList<GraphRequest>public final void add(int location,
GraphRequest request)
add in interface java.util.List<GraphRequest>add in class java.util.AbstractList<GraphRequest>public final void clear()
clear in interface java.util.Collection<GraphRequest>clear in interface java.util.List<GraphRequest>clear in class java.util.AbstractList<GraphRequest>public final GraphRequest get(int i)
get in interface java.util.List<GraphRequest>get in class java.util.AbstractList<GraphRequest>public final GraphRequest remove(int location)
remove in interface java.util.List<GraphRequest>remove in class java.util.AbstractList<GraphRequest>public final GraphRequest set(int location, GraphRequest request)
set in interface java.util.List<GraphRequest>set in class java.util.AbstractList<GraphRequest>public final int size()
size in interface java.util.Collection<GraphRequest>size in interface java.util.List<GraphRequest>size in class java.util.AbstractCollection<GraphRequest>public final java.lang.String getBatchApplicationId()
public final void setBatchApplicationId(java.lang.String batchApplicationId)
batchApplicationId - The batch application id.public final java.util.List<GraphResponse> executeAndWait()
FacebookException - If there was an error in the protocol used to communicate
with the servicejava.lang.IllegalArgumentException - if the passed in RequestBatch is emptyjava.lang.NullPointerException - if the passed in RequestBatch or any of its contents are
nullpublic final GraphRequestAsyncTask executeAsync()
GraphRequest.setCallback(GraphRequest.Callback))
This should only be called from the UI thread.java.lang.IllegalArgumentException - if this batch is emptyjava.lang.NullPointerException - if any of the contents of this batch are null