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

Comparing jsr166/src/main/java/util/Deque.java (file contents):
Revision 1.8 by jsr166, Sat May 14 02:22:28 2005 UTC vs.
Revision 1.13 by jsr166, Wed May 18 03:45:35 2005 UTC

# Line 172 | Line 172 | public interface Deque<E> extends Queue<
172       * @param e the element to add
173       * @throws IllegalStateException if the element cannot be added at this
174       *         time due to capacity restrictions
175     * @throws NullPointerException if the specified element is null and this
176     *         deque does not permit null elements
175       * @throws ClassCastException if the class of the specified element
176       *         prevents it from being added to this deque
177 +     * @throws NullPointerException if the specified element is null and this
178 +     *         deque does not permit null elements
179       * @throws IllegalArgumentException if some property of the specified
180       *         element prevents it from being added to this deque
181       */
182      void addFirst(E e);
183  
184      /**
185 <     * Inserts the specified element at the end of this deque  if it is
185 >     * Inserts the specified element at the end of this deque if it is
186       * possible to do so immediately without violating capacity restrictions.
187       * When using a capacity-restricted deque, it is generally preferable to
188       * use method {@link #offerLast}.
# Line 190 | Line 190 | public interface Deque<E> extends Queue<
190       * @param e the element to add
191       * @throws IllegalStateException if the element cannot be added at this
192       *         time due to capacity restrictions
193     * @throws NullPointerException if the specified element is null and this
194     *         deque does not permit null elements
193       * @throws ClassCastException if the class of the specified element
194       *         prevents it from being added to this deque
195 +     * @throws NullPointerException if the specified element is null and this
196 +     *         deque does not permit null elements
197       * @throws IllegalArgumentException if some property of the specified
198       *         element prevents it from being added to this deque
199       */
# Line 206 | Line 206 | public interface Deque<E> extends Queue<
206       * which can fail to insert an element only by throwing an exception.
207       *
208       * @param e the element to add
209 <     * @return <tt>true</tt> if it was possible to insert the element,
210 <     *         else <tt>false</tt>
211 <     * @throws NullPointerException if the specified element is null and this
212 <     *         deque does not permit null elements
209 >     * @return <tt>true</tt> if the element was added to this deque, else
210 >     *         <tt>false</tt>
211       * @throws ClassCastException if the class of the specified element
212       *         prevents it from being added to this deque
213 +     * @throws NullPointerException if the specified element is null and this
214 +     *         deque does not permit null elements
215       * @throws IllegalArgumentException if some property of the specified
216       *         element prevents it from being added to this deque
217       */
# Line 224 | Line 224 | public interface Deque<E> extends Queue<
224       * which can fail to insert an element only by throwing an exception.
225       *
226       * @param e the element to add
227 <     * @return <tt>true</tt> if it was possible to insert the element,
228 <     *         else <tt>false</tt>
229 <     * @throws NullPointerException if the specified element is null and this
230 <     *         deque does not permit null elements
227 >     * @return <tt>true</tt> if the element was added to this deque, else
228 >     *         <tt>false</tt>
229       * @throws ClassCastException if the class of the specified element
230       *         prevents it from being added to this deque
231 +     * @throws NullPointerException if the specified element is null and this
232 +     *         deque does not permit null elements
233       * @throws IllegalArgumentException if some property of the specified
234       *         element prevents it from being added to this deque
235       */
# Line 311 | Line 311 | public interface Deque<E> extends Queue<
311       * Removes the first occurrence of the specified element from this deque.
312       * If the deque does not contain the element, it is unchanged.
313       * More formally, removes the first element <tt>e</tt> such that
314 <     * <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists).
315 <     * Returns true if this deque contained the specified element (or
316 <     * equivalently, if this deque changed as a result of the call).
314 >     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
315 >     * (if such an element exists).
316 >     * Returns <tt>true</tt> if this deque contained the specified element
317 >     * (or equivalently, if this deque changed as a result of the call).
318       *
319       * @param o element to be removed from this deque, if present
320       * @return <tt>true</tt> if an element was removed as a result of this call
321 +     * @throws ClassCastException if the class of the specified element
322 +     *         is incompatible with this deque (optional)
323       * @throws NullPointerException if the specified element is null and this
324       *         deque does not permit null elements (optional)
322     * @throws ClassCastException if the class of the specified element
323     *         is incompatible with this collection (optional)
325       */
326      boolean removeFirstOccurrence(Object o);
327  
# Line 328 | Line 329 | public interface Deque<E> extends Queue<
329       * Removes the last occurrence of the specified element from this deque.
330       * If the deque does not contain the element, it is unchanged.
331       * More formally, removes the last element <tt>e</tt> such that
332 <     * <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists).
333 <     * Returns true if this deque contained the specified element (or
334 <     * equivalently, if this deque changed as a result of the call).
332 >     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
333 >     * (if such an element exists).
334 >     * Returns <tt>true</tt> if this deque contained the specified element
335 >     * (or equivalently, if this deque changed as a result of the call).
336       *
337       * @param o element to be removed from this deque, if present
338       * @return <tt>true</tt> if an element was removed as a result of this call
339 +     * @throws ClassCastException if the class of the specified element
340 +     *         is incompatible with this deque (optional)
341       * @throws NullPointerException if the specified element is null and this
342       *         deque does not permit null elements (optional)
339     * @throws ClassCastException if the class of the specified element
340     *         is incompatible with this collection (optional)
343       */
344      boolean removeLastOccurrence(Object o);
345  
# Line 358 | Line 360 | public interface Deque<E> extends Queue<
360       * @return <tt>true</tt> (as per the spec for {@link Collection#add})
361       * @throws IllegalStateException if the element cannot be added at this
362       *         time due to capacity restrictions
361     * @throws NullPointerException if the specified element is null and this
362     *         deque does not permit null elements
363       * @throws ClassCastException if the class of the specified element
364       *         prevents it from being added to this deque
365 +     * @throws NullPointerException if the specified element is null and this
366 +     *         deque does not permit null elements
367       * @throws IllegalArgumentException if some property of the specified
368       *         element prevents it from being added to this deque
369       */
# Line 381 | Line 383 | public interface Deque<E> extends Queue<
383       * @param e the element to add
384       * @return <tt>true</tt> if the element was added to this deque, else
385       *         <tt>false</tt>
384     * @throws NullPointerException if the specified element is null and this
385     *         deque does not permit null elements
386       * @throws ClassCastException if the class of the specified element
387       *         prevents it from being added to this deque
388 +     * @throws NullPointerException if the specified element is null and this
389 +     *         deque does not permit null elements
390       * @throws IllegalArgumentException if some property of the specified
391       *         element prevents it from being added to this deque
392       */
# Line 455 | Line 457 | public interface Deque<E> extends Queue<
457       * @param e the element to push
458       * @throws IllegalStateException if the element cannot be added at this
459       *         time due to capacity restrictions
458     * @throws NullPointerException if the specified element is null and this
459     *         deque does not permit null elements
460       * @throws ClassCastException if the class of the specified element
461       *         prevents it from being added to this deque
462 +     * @throws NullPointerException if the specified element is null and this
463 +     *         deque does not permit null elements
464       * @throws IllegalArgumentException if some property of the specified
465       *         element prevents it from being added to this deque
466       */
# Line 483 | Line 485 | public interface Deque<E> extends Queue<
485       * Removes the first occurrence of the specified element from this deque.
486       * If the deque does not contain the element, it is unchanged.
487       * More formally, removes the first element <tt>e</tt> such that
488 <     * <tt>(o==null ? e==null : o.equals(e))</tt> (if such an element exists).
489 <     * Returns true if this deque contained the specified element (or
490 <     * equivalently, if this deque changed as a result of the call).
488 >     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
489 >     * (if such an element exists).
490 >     * Returns <tt>true</tt> if this deque contained the specified element
491 >     * (or equivalently, if this deque changed as a result of the call).
492       *
493       * <p>This method is equivalent to {@link #removeFirstOccurrence}.
494       *
495       * @param o element to be removed from this deque, if present
496       * @return <tt>true</tt> if an element was removed as a result of this call
497 +     * @throws ClassCastException if the class of the specified element
498 +     *         is incompatible with this deque (optional)
499       * @throws NullPointerException if the specified element is null and this
500       *         deque does not permit null elements (optional)
496     * @throws ClassCastException if the class of the specified element
497     *         is incompatible with this collection (optional)
501       */
502      boolean remove(Object o);
503  
504      /**
505       * Returns <tt>true</tt> if this deque contains the specified element.
506 <     * More formally, returns <tt>true</tt> if and only if this deque
507 <     * contains at least one element <tt>e</tt> such that <tt>(o==null ?
508 <     * e==null : o.equals(e))</tt>.
506 >     * More formally, returns <tt>true</tt> if and only if this deque contains
507 >     * at least one element <tt>e</tt> such that
508 >     * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
509       *
510       * @param o element whose presence in this deque is to be tested
511       * @return <tt>true</tt> if this deque contains the specified element
# Line 521 | Line 524 | public interface Deque<E> extends Queue<
524      public int size();
525  
526      /**
527 <     * Returns an iterator over the elements in this deque.  The elements
528 <     * will be ordered from first (head) to last (tail).
527 >     * Returns an iterator over the elements in this deque in proper sequence.
528 >     * The elements will be returned in order from first (head) to last (tail).
529       *
530 <     * @return an <tt>Iterator</tt> over the elements in this deque
530 >     * @return an iterator over the elements in this deque in proper sequence
531       */
532      Iterator<E> iterator();
533   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines