[cvs] / jsr166 / src / main / java / util / Queue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/Queue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17, Fri Sep 12 15:38:26 2003 UTC revision 1.20, Sat Oct 18 12:29:27 2003 UTC
# Line 79  Line 79 
79   * @see java.util.concurrent.PriorityBlockingQueue   * @see java.util.concurrent.PriorityBlockingQueue
80   * @since 1.5   * @since 1.5
81   * @author Doug Lea   * @author Doug Lea
82     * @param <E> the base class of all elements held in this collection
83   */   */
84  public interface Queue<E> extends Collection<E> {  public interface Queue<E> extends Collection<E> {
85    
86      /**      /**
87       * Inserts the specified element to this queue, if possible.  When       * Inserts the specified element into this queue, if possible.  When
88       * using queues that may impose insertion restrictions (for       * using queues that may impose insertion restrictions (for
89       * example capacity bounds), method <tt>offer</tt> is generally       * example capacity bounds), method <tt>offer</tt> is generally
90       * preferable to method {@link Collection#add}, which can fail to       * preferable to method {@link Collection#add}, which can fail to
# Line 96  Line 97 
97      boolean offer(E o);      boolean offer(E o);
98    
99      /**      /**
100       * Retrieves and removes the head of this queue, if it is available.       * Retrieves and removes the head of this queue, or <tt>null</tt>
101         * if this queue is empty.
102       *       *
103       * @return the head of this queue, or <tt>null</tt> if this       * @return the head of this queue, or <tt>null</tt> if this
104       *         queue is empty.       *         queue is empty.
# Line 104  Line 106 
106      E poll();      E poll();
107    
108      /**      /**
109       * Retrieves and removes the head of this queue.       * Retrieves and removes the head of this queue.  This method
110       * This method differs       * differs from the <tt>poll</tt> method in that it throws an
111       * from the <tt>poll</tt> method in that it throws an exception if this       * exception if this queue is empty.
      * queue is empty.  
112       *       *
113       * @return the head of this queue.       * @return the head of this queue.
114       * @throws NoSuchElementException if this queue is empty.       * @throws NoSuchElementException if this queue is empty.
# Line 115  Line 116 
116      E remove();      E remove();
117    
118      /**      /**
119       * Retrieves, but does not remove, the head of this queue.       * Retrieves, but does not remove, the head of this queue,
120       * This method differs from the <tt>poll</tt>       * returning <tt>null</tt> if this queue is empty.
      * method only in that this method does not remove the head element from  
      * this queue.  
121       *       *
122       * @return the head of this queue, or <tt>null</tt> if this queue is empty.       * @return the head of this queue, or <tt>null</tt> if this queue
123         * is empty.
124       */       */
125      E peek();      E peek();
126    

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.20

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8