Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 684
نمايش فراداده

This abstract class provides a framework for simple Queue implementations. A concrete subclass must implement offer( ), peek( ), and poll( ) and must also implement the inherited size( ) and iterator( ) methods of the Collection interface. The Iterator returned by iterator( ) must support the remove( ) operation.

Figure 16-4. java.util.AbstractQueue<E>

public abstract class 

AbstractQueue<E> extends AbstractCollection<E> implements Queue<E> { // Protected Constructors protected

AbstractQueue ( ); // Methods Implementing Collection public boolean

add (E

o ); public boolean

addAll (Collection<? extends E>

c ); public void

clear ( ); // Methods Implementing Queue public E

element ( ); public E

remove ( ); }

Subclasses

PriorityQueue, java.util.concurrent.ArrayBlockingQueue,

java.util.concurrent.ConcurrentLinkedQueue, java.util.concurrent.DelayQueue, java.util.concurrent.LinkedBlockingQueue, java.util.concurrent.PriorityBlockingQueue, java.util.concurrent.SynchronousQueue