20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 /*
26 * This file is available under and governed by the GNU General Public
27 * License version 2 only, as published by the Free Software Foundation.
28 * However, the following notice accompanied the original version of this
29 * file:
30 *
31 * Written by Josh Bloch of Google Inc. and released to the public domain,
32 * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
33 */
34
35 package java.util;
36
37 import java.io.Serializable;
38 import java.util.function.Consumer;
39 import java.util.function.Predicate;
40 import java.util.function.UnaryOperator;
41 import jdk.internal.misc.SharedSecrets;
42
43 /**
44 * Resizable-array implementation of the {@link Deque} interface. Array
45 * deques have no capacity restrictions; they grow as necessary to support
46 * usage. They are not thread-safe; in the absence of external
47 * synchronization, they do not support concurrent access by multiple threads.
48 * Null elements are prohibited. This class is likely to be faster than
49 * {@link Stack} when used as a stack, and faster than {@link LinkedList}
50 * when used as a queue.
51 *
52 * <p>Most {@code ArrayDeque} operations run in amortized constant time.
53 * Exceptions include
54 * {@link #remove(Object) remove},
55 * {@link #removeFirstOccurrence removeFirstOccurrence},
56 * {@link #removeLastOccurrence removeLastOccurrence},
57 * {@link #contains contains},
58 * {@link #iterator iterator.remove()},
59 * and the bulk operations, all of which run in linear time.
60 *
61 * <p>The iterators returned by this class's {@link #iterator() iterator}
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 /*
26 * This file is available under and governed by the GNU General Public
27 * License version 2 only, as published by the Free Software Foundation.
28 * However, the following notice accompanied the original version of this
29 * file:
30 *
31 * Written by Josh Bloch of Google Inc. and released to the public domain,
32 * as explained at http://creativecommons.org/publicdomain/zero/1.0/.
33 */
34
35 package java.util;
36
37 import java.io.Serializable;
38 import java.util.function.Consumer;
39 import java.util.function.Predicate;
40
41 import jdk.internal.access.SharedSecrets;
42
43 /**
44 * Resizable-array implementation of the {@link Deque} interface. Array
45 * deques have no capacity restrictions; they grow as necessary to support
46 * usage. They are not thread-safe; in the absence of external
47 * synchronization, they do not support concurrent access by multiple threads.
48 * Null elements are prohibited. This class is likely to be faster than
49 * {@link Stack} when used as a stack, and faster than {@link LinkedList}
50 * when used as a queue.
51 *
52 * <p>Most {@code ArrayDeque} operations run in amortized constant time.
53 * Exceptions include
54 * {@link #remove(Object) remove},
55 * {@link #removeFirstOccurrence removeFirstOccurrence},
56 * {@link #removeLastOccurrence removeLastOccurrence},
57 * {@link #contains contains},
58 * {@link #iterator iterator.remove()},
59 * and the bulk operations, all of which run in linear time.
60 *
61 * <p>The iterators returned by this class's {@link #iterator() iterator}
|