Package com.zebra.rfid.api3
Class Queue
- java.lang.Object
-
- com.zebra.rfid.api3.Queue
-
public class Queue extends java.lang.ObjectQueue: implements a simple queue mechanism. Allows for enumeration of the elements.
-
-
Constructor Summary
Constructors Constructor Description Queue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdequeue()Dequeue the oldest object on the queue.java.lang.Objectdequeue(long timeOut)Dequeue the oldest object on the queue.voiddump(java.lang.String msg)java.util.Enumerationelements()Returns an enumeration of the elements in Last-In, First-Out order.voidenqueue(java.lang.Object obj)Enqueue an object.booleanisEmpty()Is the queue empty?java.util.EnumerationreverseElements()Returns an enumeration of the elements in First-In, First-Out order.
-
-
-
Method Detail
-
enqueue
public void enqueue(java.lang.Object obj)
Enqueue an object.
-
dequeue
public java.lang.Object dequeue() throws java.lang.InterruptedExceptionDequeue the oldest object on the queue. Will wait indefinitely.- Returns:
- the oldest object on the queue.
- Throws:
java.lang.InterruptedException- if any thread has interrupted this thread.
-
dequeue
public java.lang.Object dequeue(long timeOut) throws java.lang.InterruptedExceptionDequeue the oldest object on the queue.- Parameters:
timeOut- the number of milliseconds to wait for something to arrive.- Returns:
- the oldest object on the queue.
- Throws:
java.lang.InterruptedException- if any thread has interrupted this thread.
-
isEmpty
public boolean isEmpty()
Is the queue empty?- Returns:
- true if the queue is empty.
-
elements
public final java.util.Enumeration elements()
Returns an enumeration of the elements in Last-In, First-Out order. Use the Enumeration methods on the returned object to fetch the elements sequentially.
-
reverseElements
public final java.util.Enumeration reverseElements()
Returns an enumeration of the elements in First-In, First-Out order. Use the Enumeration methods on the returned object to fetch the elements sequentially.
-
dump
public void dump(java.lang.String msg)
-
-