Class Queue

java.lang.Object
com.zebra.rfid.api3.Queue

public class Queue extends Object
implements a simple queue mechanism. Allows for enumeration of the elements.
  • Constructor Details

    • Queue

      public Queue()
  • Method Details

    • enqueue

      public void enqueue(Object obj)
      Enqueue an object.
    • dequeue

      public Object dequeue() throws InterruptedException
      Dequeue the oldest object on the queue. Will wait indefinitely.
      Returns:
      the oldest object on the queue.
      Throws:
      InterruptedException - if any thread has interrupted this thread.
    • dequeue

      public Object dequeue(long timeOut) throws InterruptedException
      Dequeue 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:
      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 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 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(String msg)