ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/Queue.java
(Generate patch)

Comparing jsr166/src/main/java/util/Queue.java (file contents):
Revision 1.17 by dl, Fri Sep 12 15:38:26 2003 UTC vs.
Revision 1.21 by dl, Sun Oct 19 13:38:29 2003 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines