Package gnu.trove.queue
Interface TIntQueue
-
- All Superinterfaces:
TIntCollection
public interface TIntQueue extends TIntCollection
Interface for Trove queue implementations.- See Also:
Queue
-
-
Field Summary
-
Fields inherited from interface gnu.trove.TIntCollection
serialVersionUID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
element()
Retrieves and removes the head of this queue.boolean
offer(int e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.int
peek()
Retrieves, but does not remove, the head of this queue, or returnsTIntCollection.getNoEntryValue()
if this queue is empty.int
poll()
Retrieves and removes the head of this queue, or returnsTIntCollection.getNoEntryValue()
if this queue is empty.-
Methods inherited from interface gnu.trove.TIntCollection
add, addAll, addAll, addAll, clear, contains, containsAll, containsAll, containsAll, equals, forEach, getNoEntryValue, hashCode, isEmpty, iterator, remove, removeAll, removeAll, removeAll, retainAll, retainAll, retainAll, size, toArray, toArray
-
-
-
-
Method Detail
-
element
int element()
Retrieves and removes the head of this queue. This method differs frompoll()
only in that it throws an exception if this queue is empty.
-
offer
boolean offer(int e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. When using a capacity-restricted queue, this method is generally preferable toTIntCollection.add(int)
, which can fail to insert an element only by throwing an exception.- Parameters:
e
- The element to add.- Returns:
- true if the element was added to this queue, else false
-
peek
int peek()
Retrieves, but does not remove, the head of this queue, or returnsTIntCollection.getNoEntryValue()
if this queue is empty.- Returns:
- the head of this queue, or
TIntCollection.getNoEntryValue()
if this queue is empty
-
poll
int poll()
Retrieves and removes the head of this queue, or returnsTIntCollection.getNoEntryValue()
if this queue is empty.- Returns:
- the head of this queue, or
TIntCollection.getNoEntryValue()
if this queue is empty
-
-