public class RequestQueue
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_REQUEST_QUEUE_SIZE |
| Constructor and Description |
|---|
RequestQueue()
Creates a new instance of POPRequestQueue
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Request request)
Put a new request in the queue
|
boolean |
canPeek()
Check if there is request to peek
|
boolean |
clear()
Clear the queue
|
int |
getMaxQueue()
Return the maximum number of requests in the queue
|
Request |
peek(int time,
java.util.concurrent.TimeUnit timeUnit)
Peek a request in the queue.
|
boolean |
remove(Request request)
Remove a specific request from the queue
|
void |
setMaxQueue(int maxQueue)
Set the maximum number of requests in the queue
|
int |
size()
Give the actual number of requests in the queue
|
public static final int DEFAULT_REQUEST_QUEUE_SIZE
public int size()
public int getMaxQueue()
public void setMaxQueue(int maxQueue)
maxQueue - Maximum number of requestspublic boolean add(Request request)
request - Request to addpublic Request peek(int time, java.util.concurrent.TimeUnit timeUnit)
time - Time to waittimeUnit - Unit of timepublic boolean remove(Request request)
request - Request to be removedpublic boolean clear()
public boolean canPeek()