AbstractQueue (Java Platform SE 8 ) (original) (raw)


public abstract class AbstractQueue
extends AbstractCollection
implements Queue
This class provides skeletal implementations of some Queue operations. The implementations in this class are appropriate when the base implementation does not allow
null
elements. Methods add, remove, andelement are based on offer, poll, and peek, respectively, but throw exceptions instead of indicating failure via
false
or
null
returns.
A Queue implementation that extends this class must minimally define a method Queue.offer(E) which does not permit insertion of null elements, along with methods Queue.peek(), Queue.poll(), Collection.size(), andCollection.iterator(). Typically, additional methods will be overridden as well. If these requirements cannot be met, consider instead subclassing AbstractCollection.
This class is a member of the Java Collections Framework.
Since:
1.5

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.