From b463c6d3b0f27c8f124b5733cb9e7677542abe37 Mon Sep 17 00:00:00 2001 From: danthe1st Date: Fri, 4 Aug 2023 20:21:25 +0000 Subject: [PATCH] 8311517: Add performance information to ArrayList javadoc Reviewed-by: smarks, bpb --- src/java.base/share/classes/java/util/ArrayList.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java.base/share/classes/java/util/ArrayList.java b/src/java.base/share/classes/java/util/ArrayList.java index d136f7affce36..5fcf79e95c3f1 100644 --- a/src/java.base/share/classes/java/util/ArrayList.java +++ b/src/java.base/share/classes/java/util/ArrayList.java @@ -40,11 +40,12 @@ * {@code Vector}, except that it is unsynchronized.) * *

The {@code size}, {@code isEmpty}, {@code get}, {@code set}, - * {@code iterator}, and {@code listIterator} operations run in constant - * time. The {@code add} operation runs in amortized constant time, - * that is, adding n elements requires O(n) time. All of the other operations - * run in linear time (roughly speaking). The constant factor is low compared - * to that for the {@code LinkedList} implementation. + * {@code getFirst}, {@code getLast}, {@code removeLast}, {@code iterator}, + * {@code listIterator}, and {@code reversed} operations run in constant time. + * The {@code add}, and {@code addLast} operations runs in amortized + * constant time, that is, adding n elements requires O(n) time. All of + * the other operations run in linear time (roughly speaking). The constant + * factor is low compared to that for the {@code LinkedList} implementation. * *

Each {@code ArrayList} instance has a capacity. The capacity is * the size of the array used to store the elements in the list. It is always