Ableverse™
Platform 6.0

av.util
Interface Queue<T>

All Known Implementing Classes:
ArrayQueue, LinkedQueue

public interface Queue<T>

This is the ever absent interface from java.util package. Although a new Queue interface is introduced since java 5.0, it is mainly for concurrent messaging. And it is heavily burdened to support java collection framework. So this interface and implementation classes still have reasons to exist.

Author:
compl

Method Summary
 void clear()
          clear all
 T dequeue()
          remove the first element from the queue and return it.
<V extends T>
void
enqueue(V o)
          add o to the end of the queue.
 void enqueueAll(Collection<? extends T> collection)
          add all objects in collection to end of the queue.
 boolean isEmpty()
          test whether this queue is empty.
 T peek()
          return the first element in the queue but don't remove it from the queue.
<V extends T>
void
precede(V o)
          add o to the beginning of the queue.
 int size()
          return size of the queue.
 

Method Detail

enqueue

<V extends T> void enqueue(V o)
add o to the end of the queue.

Parameters:
o -

enqueueAll

void enqueueAll(Collection<? extends T> collection)
add all objects in collection to end of the queue.

Parameters:
collection -

precede

<V extends T> void precede(V o)
add o to the beginning of the queue.

Parameters:
o -

isEmpty

boolean isEmpty()
test whether this queue is empty.

Returns:
if this queue is empty

peek

T peek()
return the first element in the queue but don't remove it from the queue.

Returns:
the first element in this queue

dequeue

T dequeue()
remove the first element from the queue and return it.

Returns:
the first element removed from the queue

size

int size()
return size of the queue.

Returns:
size of this queue

clear

void clear()
clear all


Ableverse™
Platform 6.0

Copyright© 2006 Ableverse Platform. All rights reserved.