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.13 by jsr166, Wed May 18 03:45:35 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 187 | Line 187 | public interface Deque<E> extends Queue<
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 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 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