|  Known Direct Subclasses 
      
      
  
        
              | PriorityQueue<E> | A PriorityQueue holds elements on a priority heap, which orders the elements
 according to their natural order or according to the comparator specified at
 construction time. |  | 
Class Overview
AbstractQueue is an abstract class which implements some of the methods in
 Queue. The provided implementations of add, remove and
 element are based on offer, poll, and peek except
 that they throw exceptions to indicate some error instead of returning true
 or false.
 
Summary
| Protected Constructors | 
|---|
	 
    
        |  | AbstractQueue() Constructor to be used by subclasses. | 
| Public Methods | 
|---|
	 
    
        | boolean | add(E o) Adds an element to the queue. | 
	 
    
        | boolean | addAll(Collection<? extends E> c) Adds all the elements of a collection to the queue. | 
	 
    
        | void | clear() Removes all elements of the queue, leaving it empty. | 
	 
    
        | E | element() Returns but does not remove the element at the head of the queue. | 
	 
    
        | E | remove() Removes the element at the head of the queue and returns it. | 
| [Expand] Inherited Methods | 
|---|
|  From class
  java.util.AbstractCollection 
  
   
    
    
	 
    
        | boolean | add(E object) Attempts to add objectto the contents of thisCollection(optional). |  
        | boolean | addAll(Collection<? extends E> collection) Attempts to add all of the objects contained in collectionto the
 contents of thisCollection(optional). |  
        | void | clear() Removes all elements from this Collection, leaving it empty
 (optional). |  
        | boolean | contains(Object object) Tests whether this Collectioncontains the specified object. |  
        | boolean | containsAll(Collection<?> collection) Tests whether this Collectioncontains all objects contained in the
 specifiedCollection. |  
        | boolean | isEmpty() Returns if this Collectioncontains no elements. |  
        | abstract
            
            
            
            
            Iterator<E> | iterator() Returns an instance of  Iterator that may be used to access the
 objects contained by this  Collection. |  
        | boolean | remove(Object object) Removes one instance of the specified object from this Collectionif
 one is contained (optional). |  
        | boolean | removeAll(Collection<?> collection) Removes all occurrences in this Collectionof each object in the
 specifiedCollection(optional). |  
        | boolean | retainAll(Collection<?> collection) Removes all objects from this Collectionthat are not also found in
 theCollectionpassed (optional). |  
        | abstract
            
            
            
            
            int | size() Returns a count of how many objects this Collectioncontains. |  
        | Object[] | toArray() Returns a new array containing all elements contained in this
 ArrayList. |  
        | String | toString() Returns the string representation of this Collection. |  | 
|  From class
  java.lang.Object 
  
   
    
    
	 
    
        | boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |  
        | final
            
            
            Class<?> | getClass() Returns the runtime class of an object. |  
        | int | hashCode() Returns a hash code value for the object. |  
        | final
            
            
            void | notify() Wakes up a single thread that is waiting on this object's monitor. |  
        | final
            
            
            void | notifyAll() Wakes up all threads that are waiting on this object's monitor. |  
        | String | toString() Returns a string representation of the object. |  
        | final
            
            
            void | wait(long timeout, int nanos) Causes current thread to wait until another thread invokes the
  notify() method or the
  notifyAll() method for this object, or some other
 thread interrupts the current thread, or a certain amount of real time has
 elapsed. |  
        | final
            
            
            void | wait(long timeout) Causes current thread to wait until either another thread invokes the
  notify() method or the
  notifyAll() method for this object, or a specified
 amount of time has elapsed. |  
        | final
            
            
            void | wait() Causes current thread to wait until another thread invokes the
  notify() method or the
  notifyAll() method for this object. |  | 
|  From interface
  java.lang.Iterable | 
|  From interface
  java.util.Collection 
  
   
    
    
	 
    
        | abstract
            
            
            
            
            boolean | add(E object) Attempts to add objectto the contents of thisCollection(optional). |  
        | abstract
            
            
            
            
            boolean | addAll(Collection<? extends E> collection) Attempts to add all of the objects contained in Collectionto the
 contents of thisCollection(optional). |  
        | abstract
            
            
            
            
            void | clear() Removes all elements from this Collection, leaving it empty
 (optional). |  
        | abstract
            
            
            
            
            boolean | contains(Object object) Tests whether this Collectioncontains the specified object. |  
        | abstract
            
            
            
            
            boolean | containsAll(Collection<?> collection) Tests whether this Collectioncontains all objects contained in the
 specifiedCollection. |  
        | abstract
            
            
            
            
            boolean | equals(Object object) Compares the argument to the receiver, and returns true if they represent the
 same object using a class specific comparison. |  
        | abstract
            
            
            
            
            int | hashCode() Returns an integer hash code for the receiver. |  
        | abstract
            
            
            
            
            boolean | isEmpty() Returns if this Collectioncontains no elements. |  
        | abstract
            
            
            
            
            Iterator<E> | iterator() Returns an instance of  Iterator that may be used to access the
 objects contained by this  Collection. |  
        | abstract
            
            
            
            
            boolean | remove(Object object) Removes one instance of the specified object from this Collectionif
 one is contained (optional). |  
        | abstract
            
            
            
            
            boolean | removeAll(Collection<?> collection) Removes all occurrences in this Collectionof each object in the
 specifiedCollection(optional). |  
        | abstract
            
            
            
            
            boolean | retainAll(Collection<?> collection) Removes all objects from this Collectionthat are not also found in
 theCollectionpassed (optional). |  
        | abstract
            
            
            
            
            int | size() Returns a count of how many objects this Collectioncontains. |  
        | abstract
            
            
            
            <T>
            T[] | toArray(T[] a) Returns an array containing all of the elements in this collection; the
 runtime type of the returned array is that of the specified array. |  
        | abstract
            
            
            
            
            Object[] | toArray() Returns an array containing all of the elements in this collection. |  | 
|  From interface
  java.util.Queue 
  
   
    
    
	 
    
        | abstract
            
            
            
            
            E | element() Gets but does not remove the element at the head of the queue. |  
        | abstract
            
            
            
            
            boolean | offer(E o) Inserts the specified element into the queue provided that the condition
 allows such an operation. |  
        | abstract
            
            
            
            
            E | peek() Gets but does not remove the element at the head of the queue. |  
        | abstract
            
            
            
            
            E | poll() Gets and removes the element at the head of the queue, or returns nullif there is no element in the queue. |  
        | abstract
            
            
            
            
            E | remove() Gets and removes the element at the head of the queue. |  | 
 
Protected Constructors
 
    
      
        protected 
         
         
         
         
        
      
      AbstractQueue
      ()
    
      
    
      
  Constructor to be used by subclasses.
 
 
Public Methods
 
    
      
        public 
         
         
         
         
        boolean
      
      add
      (E o)
    
      
    
      
  Adds an element to the queue.
      Parameters
      
        
          | o | the element to be added to the queue. | 
      
   
  
      Returns
      - trueif the operation succeeds, otherwise- false.
 
  
     
 
 
    
      
        public 
         
         
         
         
        boolean
      
      addAll
      (Collection<? extends E> c)
    
      
    
      
  Adds all the elements of a collection to the queue. If the collection is the
 queue itself, then an IllegalArgumentException will be thrown. If during the
 process, some runtime exception is thrown, then those elements in the
 collection which have already successfully been added will remain in the
 queue. The result of the method is undefined if the collection is modified
 during the process of the method.
      Parameters
      
        
          | c | the collection to be added to the queue. | 
      
   
  
      Returns
      - trueif the operation succeeds, otherwise- false.
 
  
     
 
 
    
      
        public 
         
         
         
         
        void
      
      clear
      ()
    
      
    
      
  Removes all elements of the queue, leaving it empty.
 
 
 
    
      
        public 
         
         
         
         
        E
      
      element
      ()
    
      
    
      
  Returns but does not remove the element at the head of the queue.
      Returns
      - the element at the head of the queue.
 
  
     
 
 
    
      
        public 
         
         
         
         
        E
      
      remove
      ()
    
      
    
      
  Removes the element at the head of the queue and returns it.
      Returns
      - the element at the head of the queue.