public static class QueueTemplate.Queue
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
max |
Constructor and Description |
---|
QueueTemplate.Queue()
Create a new Q of a maximum possible size
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the queue.
|
long |
count()
Return the total number of items Q'd.
|
java.lang.Object |
get(int timeout)
Return the next item on the queue, waiting for up to
"timeout" seconds or for an interrupt.
|
long |
getCreated()
Return creation time (ms since epoch).
|
long |
getExpires()
Get the expiration period of the Queue (in ms).
|
boolean |
isClosed()
Get the closed state.
|
void |
kick()
Send a notify: for debugging
|
long |
lastIn()
Return the last time a Q insertion was attempted.
|
long |
lastOut()
Return the last time a Q removal was attempted.
|
boolean |
put(java.lang.Object item)
Put an item on the queue if it's open and not full.
|
boolean |
put(java.lang.Object item,
boolean force)
Put an item on the queue if it's not full.
|
boolean |
setClosed(boolean closed)
Set the closed state.
|
void |
setExpires(long expires)
Set the expiration period of the Queue (in ms).
|
int |
size()
How many items are queue'd.
|
java.lang.String |
toString() |
public QueueTemplate.Queue()
public java.lang.Object get(int timeout)
public boolean put(java.lang.Object item)
public boolean put(java.lang.Object item, boolean force)
public int size()
public void kick()
public long lastIn()
public long lastOut()
public long count()
public long getExpires()
public void setExpires(long expires)
public long getCreated()
public void clear()
public boolean setClosed(boolean closed)
public boolean isClosed()
public java.lang.String toString()
toString
in class java.lang.Object