sunlabs.brazil.template
public static class QueueTemplate.Queue extends Object
| Field Summary | |
|---|---|
| static int | max |
| Constructor Summary | |
|---|---|
| Queue()
Create a new Q of a maximum possible size | |
| Method Summary | |
|---|---|
| void | clear()
Clear the queue. |
| long | count()
Return the total number of items Q'd. |
| 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(Object item)
Put an item on the queue if it's open and not full. |
| boolean | put(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. |
| String | toString() |
Returns: The # of Q'd items.
Returns: the top of the Q, or null.
Returns: -1 if no attempts were made.
Returns: -1 if no attempts were made.