equal
deleted
inserted
replaced
54 * operations cannot fail. |
54 * operations cannot fail. |
55 * |
55 * |
56 * <p>The twelve methods described above are summarized in the |
56 * <p>The twelve methods described above are summarized in the |
57 * following table: |
57 * following table: |
58 * |
58 * |
59 * <p> |
|
60 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
59 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
61 * <caption>Summary of Deque methods</caption> |
60 * <caption>Summary of Deque methods</caption> |
62 * <tr> |
61 * <tr> |
63 * <td></td> |
62 * <td></td> |
64 * <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td> |
63 * <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td> |
98 * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are |
97 * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are |
99 * added at the end of the deque and removed from the beginning. The methods |
98 * added at the end of the deque and removed from the beginning. The methods |
100 * inherited from the {@code Queue} interface are precisely equivalent to |
99 * inherited from the {@code Queue} interface are precisely equivalent to |
101 * {@code Deque} methods as indicated in the following table: |
100 * {@code Deque} methods as indicated in the following table: |
102 * |
101 * |
103 * <p> |
|
104 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
102 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
105 * <caption>Comparison of Queue and Deque methods</caption> |
103 * <caption>Comparison of Queue and Deque methods</caption> |
106 * <tr> |
104 * <tr> |
107 * <td ALIGN=CENTER> <b>{@code Queue} Method</b></td> |
105 * <td ALIGN=CENTER> <b>{@code Queue} Method</b></td> |
108 * <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |
106 * <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |
137 * interface should be used in preference to the legacy {@link Stack} class. |
135 * interface should be used in preference to the legacy {@link Stack} class. |
138 * When a deque is used as a stack, elements are pushed and popped from the |
136 * When a deque is used as a stack, elements are pushed and popped from the |
139 * beginning of the deque. Stack methods are precisely equivalent to |
137 * beginning of the deque. Stack methods are precisely equivalent to |
140 * {@code Deque} methods as indicated in the table below: |
138 * {@code Deque} methods as indicated in the table below: |
141 * |
139 * |
142 * <p> |
|
143 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
140 * <table BORDER CELLPADDING=3 CELLSPACING=1> |
144 * <caption>Comparison of Stack and Deque methods</caption> |
141 * <caption>Comparison of Stack and Deque methods</caption> |
145 * <tr> |
142 * <tr> |
146 * <td ALIGN=CENTER> <b>Stack Method</b></td> |
143 * <td ALIGN=CENTER> <b>Stack Method</b></td> |
147 * <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |
144 * <td ALIGN=CENTER> <b>Equivalent {@code Deque} Method</b></td> |