Class LinkedQueue<E>

java.lang.Object
org.serviceconnector.util.LinkedQueue<E>
Type Parameters:
E - the element type

public class LinkedQueue<E> extends Object
The Class LinkedQueue. Base Queue to implement consumer/producer modules.
  • Constructor Details

    • LinkedQueue

      public LinkedQueue()
      Instantiates a LinkedQueue.
  • Method Details

    • getFirst

      public LinkedNode<E> getFirst()
      Gets the first node.
      Returns:
      the first
    • getLast

      public LinkedNode<E> getLast()
      Gets the this.last.
      Returns:
      the this.last
    • nodeIterator

      public Iterator<LinkedNode<E>> nodeIterator()
      Node iterator.
      Returns:
      the iterator
    • getSize

      public int getSize()
      Gets the this.size.
      Returns:
      the this.size
    • insert

      public LinkedNode<E> insert(E value)
      Main mechanics to insert in queue. Null value not allowed.
      Parameters:
      value - the value for new node
      Returns:
      the linked node
    • extract

      public E extract()
      Main mechanics for extract from queue. If no message in queue null will be returned.
      Returns:
      the object
    • peek

      public E peek()
      Peek. Returns first value - if there is no first node null will be returned.
      Returns:
      the object
    • isEmpty

      public boolean isEmpty()
      Checks if is empty.
      Returns:
      true, if is empty