com.android.volley
クラス RequestQueue

java.lang.Object
  上位を拡張 com.android.volley.RequestQueue

public class RequestQueue
extends java.lang.Object

A request dispatch queue with a thread pool of dispatchers. Calling add(Request) will enqueue the given Request for dispatch, resolving from either cache or network on a worker thread, and then delivering a parsed response on the main thread.


入れ子のクラスの概要
static interface RequestQueue.RequestFilter
          A simple predicate or filter interface for Requests, for use by cancelAll(RequestFilter).
 
コンストラクタの概要
RequestQueue(Cache cache, Network network)
          Creates the worker pool.
RequestQueue(Cache cache, Network network, int threadPoolSize)
          Creates the worker pool.
RequestQueue(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery)
          Creates the worker pool.
 
メソッドの概要
 Request add(Request request)
          Adds a Request to the dispatch queue.
 void cancelAll(java.lang.Object tag)
          Cancels all requests in this queue with the given tag.
 void cancelAll(RequestQueue.RequestFilter filter)
          Cancels all requests in this queue for which the given filter applies.
 Cache getCache()
          Gets the Cache instance being used.
 int getSequenceNumber()
          Gets a sequence number.
 void start()
          Starts the dispatchers in this queue.
 void stop()
          Stops the cache and network dispatchers.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

RequestQueue

public RequestQueue(Cache cache,
                    Network network,
                    int threadPoolSize,
                    ResponseDelivery delivery)
Creates the worker pool. Processing will not begin until start() is called.

パラメータ:
cache - A Cache to use for persisting responses to disk
network - A Network interface for performing HTTP requests
threadPoolSize - Number of network dispatcher threads to create
delivery - A ResponseDelivery interface for posting responses and errors

RequestQueue

public RequestQueue(Cache cache,
                    Network network,
                    int threadPoolSize)
Creates the worker pool. Processing will not begin until start() is called.

パラメータ:
cache - A Cache to use for persisting responses to disk
network - A Network interface for performing HTTP requests
threadPoolSize - Number of network dispatcher threads to create

RequestQueue

public RequestQueue(Cache cache,
                    Network network)
Creates the worker pool. Processing will not begin until start() is called.

パラメータ:
cache - A Cache to use for persisting responses to disk
network - A Network interface for performing HTTP requests
メソッドの詳細

start

public void start()
Starts the dispatchers in this queue.


stop

public void stop()
Stops the cache and network dispatchers.


getSequenceNumber

public int getSequenceNumber()
Gets a sequence number.


getCache

public Cache getCache()
Gets the Cache instance being used.


cancelAll

public void cancelAll(RequestQueue.RequestFilter filter)
Cancels all requests in this queue for which the given filter applies.

パラメータ:
filter - The filtering function to use

cancelAll

public void cancelAll(java.lang.Object tag)
Cancels all requests in this queue with the given tag. Tag must be non-null and equality is by identity.


add

public Request add(Request request)
Adds a Request to the dispatch queue.

パラメータ:
request - The request to service
戻り値:
The passed-in request