Moyosoft Products | Services | Download | Contact us    
JavaDocPlus
Products  >  JavaDocPlus  >  Online demo    


Latest release




Get a FREE license !
(Special offer, time limited)

Review JavaDocPlus on your blog and we'll give you a free license.

Open source projects licenced under LGPL, EPL, ASL, BSD or MIT can also obtain a free license.

Contact us to check if your project/blog is eligible.

Online demo
JavaDocPlus Demo  |  Show in full page mode
   
Overview  |  
Classic JavaDoc

Class AbstractQueue

java.lang.Objectjava.util.AbstractCollectionjava.util.AbstractQueue

Implemented Interfaces:
Direct Known Subclasses:

public abstract class AbstractQueue extends AbstractCollection implements Queue

This class provides skeletal implementations of some operations. The implementations in this class are appropriate when the base implementation does not allow null elements. Methods add, remove, and element 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 which does not permit insertion of null elements, along with methods , , , and a supporting . Typically, additional methods will be overridden as well. If these requirements cannot be met, consider instead subclassing .

This class is a member of the Java Collections Framework.

Since:
1.5

Author:
Doug Lea

Parameters:
   the type of elements held in this collection

Constructors

protected
AbstractQueue ()
Constructor for use by subclasses.

Methods

boolean
add (Object o)
Adds the specified element to this queue. This implementation returns true if offer succeeds, else throws an IllegalStateException.
boolean
addAll (Collection c)
Adds all of the elements in the specified collection to this queue. Attempts to addAll of a queue to itself result in IllegalArgumentException. Further, the behavior of this operation is undefined if the specified collection is modified while the operation is in progress. This impl ... more >
void
clear ()
Removes all of the elements from this collection. The collection will be empty after this call returns. This implementation repeatedly invokes poll until it returns null.
element ()
Retrieves, but does not remove, the head of this queue. This implementation returns the result of peek unless the queue is empty.
remove ()
Retrieves and removes the head of this queue. This implementation returns the result of poll unless the queue is empty.

Inherited methods

Community comments



Powered by JavaDocPlus