public class Queue extends Object
| Modifier and Type | Field and Description |
|---|---|
int |
appendTimeoutTime
Deprecated.
The time to wait until an attempt to append an item times out.
|
static int |
DEFAULT_APPEND_TIMEOUT
Deprecated.
Default timeout of 0 for a blocking append call.
|
static int |
DEFAULT_GET_TIMEOUT
Deprecated.
Default timeout of 0 for a blocking get call.
|
static int |
DEFAULT_QUEUE_SIZE
Deprecated.
Default size of 32 for the queue if none is specified.
|
(package private) int |
flip
Deprecated.
|
(package private) long |
get1
Deprecated.
|
(package private) long |
get2
Deprecated.
|
int |
getTimeoutTime
Deprecated.
The time to wait until an attempt to get an item times out.
|
(package private) QueueElement |
head
Deprecated.
The head element of the queue.
|
Vector |
items
Deprecated.
|
(package private) int |
len
Deprecated.
The real number of items in the queue.
|
(package private) QueueElement |
tail
Deprecated.
The tail element of the queue.
|
| Constructor and Description |
|---|
Queue()
Deprecated.
Constructs the queue with the default queue size set to
DEFAULT_QUEUE_SIZE, and the append timeout set to
DEFAULT_APPEND_TIMEOUT
|
Queue(int size)
Deprecated.
Constructs the queue, sets the max number of queueable
items to the given size, sets the append timeout
to DEFAULT_APPEND_TIMEOUT, and sets the get timeout to
DEFAULT_GET_TIMEOUT
|
Queue(int size,
int appendTimeout,
int getTimeout)
Deprecated.
Constructs the queue, sets the max number of queueable
items to the given size, and sets the append() and get() timeouts
to the given values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(Object item)
Deprecated.
Appends the given item to the queue.
|
void |
appendTimeout()
Deprecated.
This is called every time we timeout while waiting to append
something to the queue.
|
int |
count()
Deprecated.
Returns the number of items currently in the queue.
|
Object |
get()
Deprecated.
Pulls an item off of the queue.
|
void |
getTimeout()
Deprecated.
Pretty much the same thing as the getTimeout() method, but for
blocking get() timeouts.
|
void |
newQueue(int size,
int appendTimeout,
int getTimeout)
Deprecated.
Re-uinitializes the queue, sets the max number of queueable
items to the given size, and sets the append() and get() timeouts
to the given values.
|
int |
queueSize()
Deprecated.
Returns the size of the queue
|
void |
resize(int newsize)
Deprecated.
Resizes the queue so that it can contain at most the given
number of items in it.
|
public static int DEFAULT_QUEUE_SIZE
public static int DEFAULT_APPEND_TIMEOUT
public static int DEFAULT_GET_TIMEOUT
public int appendTimeoutTime
public int getTimeoutTime
QueueElement head
get().QueueElement tail
append(java.lang.Object).int len
public Vector items
int flip
long get1
long get2
public Queue()
DEFAULT_QUEUE_SIZE,
DEFAULT_APPEND_TIMEOUTpublic Queue(int size)
size - The maximum size of the queueDEFAULT_APPEND_TIMEOUTpublic Queue(int size,
int appendTimeout,
int getTimeout)
size - The maximum size of the queueappendTimeout - If we can't append() within this many milliseconds,
the appendTimeout() method is called before retrying.getTimeout - If we can't get() something within this many
milliseconds, the getTimeout() method is called.appendTimeout(),
getTimeout()public void newQueue(int size,
int appendTimeout,
int getTimeout)
size - The maximum size of the queueappendTimeout - If we can't append() within this many milliseconds,
the appendTimeout() method is called before retrying.getTimeout - If we can't get() something within this many
milliseconds, the getTimeout() method is called.public int queueSize()
public int count()
public void append(Object item)
item - The item to be appended to the queuepublic Object get() throws InterruptedException
InterruptedExceptionpublic void appendTimeout()
appendTimeoutTimepublic void getTimeout()
getTimeoutTimepublic void resize(int newsize)
newsize - The new maximum size of the queueMMBase 1.9-SNAPSHOT - ${javadoctimestamp}