[cvs] / jsr166 / src / main / java / util / Queue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/Queue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43, Tue Dec 1 06:59:28 2015 UTC revision 1.47, Sat May 6 06:55:50 2017 UTC
# Line 8  Line 8 
8    
9  /**  /**
10   * A collection designed for holding elements prior to processing.   * A collection designed for holding elements prior to processing.
11   * Besides basic {@link java.util.Collection Collection} operations,   * Besides basic {@link Collection} operations, queues provide
12   * queues provide additional insertion, extraction, and inspection   * additional insertion, extraction, and inspection operations.
13   * operations.  Each of these methods exists in two forms: one throws   * Each of these methods exists in two forms: one throws an exception
14   * an exception if the operation fails, the other returns a special   * if the operation fails, the other returns a special value (either
15   * value (either {@code null} or {@code false}, depending on the   * {@code null} or {@code false}, depending on the operation).  The
16   * operation).  The latter form of the insert operation is designed   * latter form of the insert operation is designed specifically for
17   * specifically for use with capacity-restricted {@code Queue}   * use with capacity-restricted {@code Queue} implementations; in most
18   * implementations; in most implementations, insert operations cannot   * implementations, insert operations cannot fail.
  * fail.  
19   *   *
20   * <table BORDER CELLPADDING=3 CELLSPACING=1>   * <table BORDER CELLPADDING=3 CELLSPACING=1>
21   * <caption>Summary of Queue methods</caption>   * <caption>Summary of Queue methods</caption>
22   *  <tr>   *  <tr>
23   *    <td></td>   *    <td></td>
24   *    <td ALIGN=CENTER><em>Throws exception</em></td>   *    <td style="text-align:center"><em>Throws exception</em></td>
25   *    <td ALIGN=CENTER><em>Returns special value</em></td>   *    <td style="text-align:center"><em>Returns special value</em></td>
26   *  </tr>   *  </tr>
27   *  <tr>   *  <tr>
28   *    <td><b>Insert</b></td>   *    <td><b>Insert</b></td>
29   *    <td>{@link Queue#add add(e)}</td>   *    <td>{@link #add(Object) add(e)}</td>
30   *    <td>{@link Queue#offer offer(e)}</td>   *    <td>{@link #offer(Object) offer(e)}</td>
31   *  </tr>   *  </tr>
32   *  <tr>   *  <tr>
33   *    <td><b>Remove</b></td>   *    <td><b>Remove</b></td>
34   *    <td>{@link Queue#remove remove()}</td>   *    <td>{@link #remove() remove()}</td>
35   *    <td>{@link Queue#poll poll()}</td>   *    <td>{@link #poll() poll()}</td>
36   *  </tr>   *  </tr>
37   *  <tr>   *  <tr>
38   *    <td><b>Examine</b></td>   *    <td><b>Examine</b></td>
39   *    <td>{@link Queue#element element()}</td>   *    <td>{@link #element() element()}</td>
40   *    <td>{@link Queue#peek peek()}</td>   *    <td>{@link #peek() peek()}</td>
41   *  </tr>   *  </tr>
42   * </table>   * </table>
43   *   *
# Line 95  Line 94 
94   * always well-defined for queues with the same elements but different   * always well-defined for queues with the same elements but different
95   * ordering properties.   * ordering properties.
96   *   *
  *  
97   * <p>This interface is a member of the   * <p>This interface is a member of the
98   * <a href="{@docRoot}/../technotes/guides/collections/index.html">   * <a href="{@docRoot}/java/util/package-summary.html#CollectionsFramework">
99   * Java Collections Framework</a>.   * Java Collections Framework</a>.
100   *   *
101   * @since 1.5   * @since 1.5
# Line 145  Line 143 
143    
144      /**      /**
145       * Retrieves and removes the head of this queue.  This method differs       * Retrieves and removes the head of this queue.  This method differs
146       * from {@link #poll poll} only in that it throws an exception if this       * from {@link #poll() poll()} only in that it throws an exception if
147       * queue is empty.       * this queue is empty.
148       *       *
149       * @return the head of this queue       * @return the head of this queue
150       * @throws NoSuchElementException if this queue is empty       * @throws NoSuchElementException if this queue is empty

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.47

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8