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.19 by dl, Mon Sep 15 12:02:23 2003 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines