Package org.serviceconnector.util
Class LinkedQueue<E>
java.lang.Object
org.serviceconnector.util.LinkedQueue<E>
- Type Parameters:
E- the element type
The Class LinkedQueue. Base Queue to implement consumer/producer modules.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LinkedQueue
public LinkedQueue()Instantiates a LinkedQueue.
-
-
Method Details
-
getFirst
Gets the first node.- Returns:
- the first
-
getLast
Gets the this.last.- Returns:
- the this.last
-
nodeIterator
Node iterator.- Returns:
- the iterator
-
getSize
public int getSize()Gets the this.size.- Returns:
- the this.size
-
insert
Main mechanics to insert in queue. Null value not allowed.- Parameters:
value- the value for new node- Returns:
- the linked node
-
extract
Main mechanics for extract from queue. If no message in queue null will be returned.- Returns:
- the object
-
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
-