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

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

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

revision 1.39, Wed May 31 19:02:33 2017 UTC revision 1.40, Wed Aug 23 20:17:53 2017 UTC
# Line 27  Line 27 
27   * <p>The twelve methods described above are summarized in the   * <p>The twelve methods described above are summarized in the
28   * following table:   * following table:
29   *   *
30   * <table class="plain">   * <table class="striped">
31   * <caption>Summary of Deque methods</caption>   * <caption>Summary of Deque methods</caption>
32     *  <thead>
33   *  <tr>   *  <tr>
34   *    <td></td>   *    <td rowspan="2"></td>
35   *    <td style="text-align:center" COLSPAN = 2> <b>First Element (Head)</b></td>   *    <th scope="col" colspan="2"> First Element (Head)</th>
36   *    <td style="text-align:center" COLSPAN = 2> <b>Last Element (Tail)</b></td>   *    <th scope="col" colspan="2"> Last Element (Tail)</th>
37   *  </tr>   *  </tr>
38   *  <tr>   *  <tr>
39   *    <td></td>   *    <th scope="col" style="font-weight:normal; font-style:italic">Throws exception</th>
40   *    <td style="text-align:center"><em>Throws exception</em></td>   *    <th scope="col" style="font-weight:normal; font-style:italic">Special value</th>
41   *    <td style="text-align:center"><em>Special value</em></td>   *    <th scope="col" style="font-weight:normal; font-style:italic">Throws exception</th>
42   *    <td style="text-align:center"><em>Throws exception</em></td>   *    <th scope="col" style="font-weight:normal; font-style:italic">Special value</th>
  *    <td style="text-align:center"><em>Special value</em></td>  
43   *  </tr>   *  </tr>
44     *  </thead>
45     *  <tbody>
46   *  <tr>   *  <tr>
47   *    <td><b>Insert</b></td>   *    <th scope="row">Insert</th>
48   *    <td>{@link #addFirst(Object) addFirst(e)}</td>   *    <td>{@link #addFirst(Object) addFirst(e)}</td>
49   *    <td>{@link #offerFirst(Object) offerFirst(e)}</td>   *    <td>{@link #offerFirst(Object) offerFirst(e)}</td>
50   *    <td>{@link #addLast(Object) addLast(e)}</td>   *    <td>{@link #addLast(Object) addLast(e)}</td>
51   *    <td>{@link #offerLast(Object) offerLast(e)}</td>   *    <td>{@link #offerLast(Object) offerLast(e)}</td>
52   *  </tr>   *  </tr>
53   *  <tr>   *  <tr>
54   *    <td><b>Remove</b></td>   *    <th scope="row">Remove</th>
55   *    <td>{@link #removeFirst() removeFirst()}</td>   *    <td>{@link #removeFirst() removeFirst()}</td>
56   *    <td>{@link #pollFirst() pollFirst()}</td>   *    <td>{@link #pollFirst() pollFirst()}</td>
57   *    <td>{@link #removeLast() removeLast()}</td>   *    <td>{@link #removeLast() removeLast()}</td>
58   *    <td>{@link #pollLast() pollLast()}</td>   *    <td>{@link #pollLast() pollLast()}</td>
59   *  </tr>   *  </tr>
60   *  <tr>   *  <tr>
61   *    <td><b>Examine</b></td>   *    <th scope="row">Examine</th>
62   *    <td>{@link #getFirst() getFirst()}</td>   *    <td>{@link #getFirst() getFirst()}</td>
63   *    <td>{@link #peekFirst() peekFirst()}</td>   *    <td>{@link #peekFirst() peekFirst()}</td>
64   *    <td>{@link #getLast() getLast()}</td>   *    <td>{@link #getLast() getLast()}</td>
65   *    <td>{@link #peekLast() peekLast()}</td>   *    <td>{@link #peekLast() peekLast()}</td>
66   *  </tr>   *  </tr>
67     *  </tbody>
68   * </table>   * </table>
69   *   *
70   * <p>This interface extends the {@link Queue} interface.  When a deque is   * <p>This interface extends the {@link Queue} interface.  When a deque is
# Line 70  Line 73 
73   * inherited from the {@code Queue} interface are precisely equivalent to   * inherited from the {@code Queue} interface are precisely equivalent to
74   * {@code Deque} methods as indicated in the following table:   * {@code Deque} methods as indicated in the following table:
75   *   *
76   * <table class="plain">   * <table class="striped">
77   * <caption>Comparison of Queue and Deque methods</caption>   * <caption>Comparison of Queue and Deque methods</caption>
78     *  <thead>
79   *  <tr>   *  <tr>
80   *    <td style="text-align:center"> <b>{@code Queue} Method</b></td>   *    <th scope="col"> {@code Queue} Method</th>
81   *    <td style="text-align:center"> <b>Equivalent {@code Deque} Method</b></td>   *    <th scope="col"> Equivalent {@code Deque} Method</th>
82   *  </tr>   *  </tr>
83     *  </thead>
84     *  <tbody>
85   *  <tr>   *  <tr>
86   *    <td>{@link #add(Object) add(e)}</td>   *    <th scope="row">{@link #add(Object) add(e)}</th>
87   *    <td>{@link #addLast(Object) addLast(e)}</td>   *    <td>{@link #addLast(Object) addLast(e)}</td>
88   *  </tr>   *  </tr>
89   *  <tr>   *  <tr>
90   *    <td>{@link #offer(Object) offer(e)}</td>   *    <th scope="row">{@link #offer(Object) offer(e)}</th>
91   *    <td>{@link #offerLast(Object) offerLast(e)}</td>   *    <td>{@link #offerLast(Object) offerLast(e)}</td>
92   *  </tr>   *  </tr>
93   *  <tr>   *  <tr>
94   *    <td>{@link #remove() remove()}</td>   *    <th scope="row">{@link #remove() remove()}</th>
95   *    <td>{@link #removeFirst() removeFirst()}</td>   *    <td>{@link #removeFirst() removeFirst()}</td>
96   *  </tr>   *  </tr>
97   *  <tr>   *  <tr>
98   *    <td>{@link #poll() poll()}</td>   *    <th scope="row">{@link #poll() poll()}</th>
99   *    <td>{@link #pollFirst() pollFirst()}</td>   *    <td>{@link #pollFirst() pollFirst()}</td>
100   *  </tr>   *  </tr>
101   *  <tr>   *  <tr>
102   *    <td>{@link #element() element()}</td>   *    <th scope="row">{@link #element() element()}</th>
103   *    <td>{@link #getFirst() getFirst()}</td>   *    <td>{@link #getFirst() getFirst()}</td>
104   *  </tr>   *  </tr>
105   *  <tr>   *  <tr>
106   *    <td>{@link #peek() peek()}</td>   *    <th scope="row">{@link #peek() peek()}</th>
107   *    <td>{@link #peekFirst() peekFirst()}</td>   *    <td>{@link #peekFirst() peekFirst()}</td>
108   *  </tr>   *  </tr>
109     *  </tbody>
110   * </table>   * </table>
111   *   *
112   * <p>Deques can also be used as LIFO (Last-In-First-Out) stacks.  This   * <p>Deques can also be used as LIFO (Last-In-First-Out) stacks.  This
# Line 108  Line 115 
115   * beginning of the deque.  Stack methods are precisely equivalent to   * beginning of the deque.  Stack methods are precisely equivalent to
116   * {@code Deque} methods as indicated in the table below:   * {@code Deque} methods as indicated in the table below:
117   *   *
118   * <table class="plain">   * <table class="striped">
119   * <caption>Comparison of Stack and Deque methods</caption>   * <caption>Comparison of Stack and Deque methods</caption>
120     *  <thead>
121   *  <tr>   *  <tr>
122   *    <td style="text-align:center"> <b>Stack Method</b></td>   *    <th scope="col"> Stack Method</th>
123   *    <td style="text-align:center"> <b>Equivalent {@code Deque} Method</b></td>   *    <th scope="col"> Equivalent {@code Deque} Method</th>
124   *  </tr>   *  </tr>
125     *  </thead>
126     *  <tbody>
127   *  <tr>   *  <tr>
128   *    <td>{@link #push(Object) push(e)}</td>   *    <th scope="row">{@link #push(Object) push(e)}</th>
129   *    <td>{@link #addFirst(Object) addFirst(e)}</td>   *    <td>{@link #addFirst(Object) addFirst(e)}</td>
130   *  </tr>   *  </tr>
131   *  <tr>   *  <tr>
132   *    <td>{@link #pop() pop()}</td>   *    <th scope="row">{@link #pop() pop()}</th>
133   *    <td>{@link #removeFirst() removeFirst()}</td>   *    <td>{@link #removeFirst() removeFirst()}</td>
134   *  </tr>   *  </tr>
135   *  <tr>   *  <tr>
136   *    <td>{@link #peek() peek()}</td>   *    <th scope="row">{@link #peek() peek()}</th>
137   *    <td>{@link #peekFirst() peekFirst()}</td>   *    <td>{@link #peekFirst() peekFirst()}</td>
138   *  </tr>   *  </tr>
139     *  </tbody>
140   * </table>   * </table>
141   *   *
142   * <p>Note that the {@link #peek peek} method works equally well when   * <p>Note that the {@link #peek peek} method works equally well when

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8