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.11 by jsr166, Tue May 17 16:00:48 2005 UTC vs.
Revision 1.19 by jsr166, Sun May 28 23:36:29 2006 UTC

# Line 153 | Line 153 | package java.util;
153   * <tt>Object</tt>.
154   *
155   * <p>This interface is a member of the <a
156 < * href="{@docRoot}/../guide/collections/index.html"> Java Collections
156 > * href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections
157   * Framework</a>.
158   *
159   * @author Doug Lea
# Line 182 | Line 182 | public interface Deque<E> extends Queue<
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}.
189       *
190 +     * <p>This method is equivalent to {@link #add}.
191 +     *
192       * @param e the element to add
193       * @throws IllegalStateException if the element cannot be added at this
194       *         time due to capacity restrictions
# Line 237 | Line 239 | public interface Deque<E> extends Queue<
239  
240      /**
241       * Retrieves and removes the first element of this deque.  This method
242 <     * differs from {@link #pollFirst} only in that it throws an exception
243 <     * if this deque is empty.
242 >     * differs from {@link #pollFirst pollFirst} only in that it throws an
243 >     * exception if this deque is empty.
244       *
245       * @return the head of this deque
246       * @throws NoSuchElementException if this deque is empty
# Line 247 | Line 249 | public interface Deque<E> extends Queue<
249  
250      /**
251       * Retrieves and removes the last element of this deque.  This method
252 <     * differs from {@link #pollLast} only in that it throws an exception if
253 <     * this deque is empty.
252 >     * differs from {@link #pollLast pollLast} only in that it throws an
253 >     * exception if this deque is empty.
254       *
255       * @return the tail of this deque
256       * @throws NoSuchElementException if this deque is empty
# Line 273 | Line 275 | public interface Deque<E> extends Queue<
275  
276      /**
277       * Retrieves, but does not remove, the first element of this deque.
278 <     * This method differs from {@link #peekFirst} only in that it throws an
279 <     * exception if this deque is empty.
278 >     *
279 >     * This method differs from {@link #peekFirst peekFirst} only in that it
280 >     * throws an exception if this deque is empty.
281       *
282       * @return the head of this deque
283       * @throws NoSuchElementException if this deque is empty
# Line 283 | Line 286 | public interface Deque<E> extends Queue<
286  
287      /**
288       * Retrieves, but does not remove, the last element of this deque.
289 <     * This method differs from {@link #peekLast} only in that it throws an
290 <     * exception if this deque is empty.
289 >     * This method differs from {@link #peekLast peekLast} only in that it
290 >     * throws an exception if this deque is empty.
291       *
292       * @return the tail of this deque
293       * @throws NoSuchElementException if this deque is empty
# Line 313 | Line 316 | public interface Deque<E> extends Queue<
316       * More formally, removes the first element <tt>e</tt> such that
317       * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
318       * (if such an element exists).
319 <     * Returns true if this deque contained the specified element (or
320 <     * equivalently, if this deque changed as a result of the call).
319 >     * Returns <tt>true</tt> if this deque contained the specified element
320 >     * (or equivalently, if this deque changed as a result of the call).
321       *
322       * @param o element to be removed from this deque, if present
323       * @return <tt>true</tt> if an element was removed as a result of this call
# Line 331 | Line 334 | public interface Deque<E> extends Queue<
334       * More formally, removes the last element <tt>e</tt> such that
335       * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
336       * (if such an element exists).
337 <     * Returns true if this deque contained the specified element (or
338 <     * equivalently, if this deque changed as a result of the call).
337 >     * Returns <tt>true</tt> if this deque contained the specified element
338 >     * (or equivalently, if this deque changed as a result of the call).
339       *
340       * @param o element to be removed from this deque, if present
341       * @return <tt>true</tt> if an element was removed as a result of this call
# Line 354 | Line 357 | public interface Deque<E> extends Queue<
357       * When using a capacity-restricted deque, it is generally preferable to
358       * use {@link #offer(Object) offer}.
359       *
360 <     * <p>This method is equivalent to {@link #addLast(Object) addLast}.
360 >     * <p>This method is equivalent to {@link #addLast}.
361       *
362       * @param e the element to add
363 <     * @return <tt>true</tt> (as per the spec for {@link Collection#add})
363 >     * @return <tt>true</tt> (as specified by {@link Collection#add})
364       * @throws IllegalStateException if the element cannot be added at this
365       *         time due to capacity restrictions
366       * @throws ClassCastException if the class of the specified element
# Line 395 | Line 398 | public interface Deque<E> extends Queue<
398      /**
399       * Retrieves and removes the head of the queue represented by this deque
400       * (in other words, the first element of this deque).
401 <     * This method differs from {@link #poll} only in that it throws an
401 >     * This method differs from {@link #poll poll} only in that it throws an
402       * exception if this deque is empty.
403       *
404       * <p>This method is equivalent to {@link #removeFirst()}.
# Line 420 | Line 423 | public interface Deque<E> extends Queue<
423      /**
424       * Retrieves, but does not remove, the head of the queue represented by
425       * this deque (in other words, the first element of this deque).
426 <     * This method differs from {@link #peek} only in that it throws an
426 >     * This method differs from {@link #peek peek} only in that it throws an
427       * exception if this deque is empty.
428       *
429       * <p>This method is equivalent to {@link #getFirst()}.
# Line 487 | Line 490 | public interface Deque<E> extends Queue<
490       * More formally, removes the first element <tt>e</tt> such that
491       * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>
492       * (if such an element exists).
493 <     * Returns true if this deque contained the specified element (or
494 <     * equivalently, if this deque changed as a result of the call).
493 >     * Returns <tt>true</tt> if this deque contained the specified element
494 >     * (or equivalently, if this deque changed as a result of the call).
495       *
496       * <p>This method is equivalent to {@link #removeFirstOccurrence}.
497       *
# Line 530 | Line 533 | public interface Deque<E> extends Queue<
533       * @return an iterator over the elements in this deque in proper sequence
534       */
535      Iterator<E> iterator();
536 +
537 +    /**
538 +     * Returns an iterator over the elements in this deque in reverse
539 +     * sequential order.  The elements will be returned in order from
540 +     * last (tail) to first (head).
541 +     *
542 +     * @return an iterator over the elements in this deque in reverse
543 +     * sequence
544 +     */
545 +    Iterator<E> descendingIterator();
546 +
547   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines