-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
ArrayDeque stores its elements in an array, but it doesn't implement the List interface. This means that it doesn't allow access to elements by index. It should be only a moderate amount of effort ot allow this, as mapping the list index into the array index is only a bit of arithmetic and logic.
The new methods that need to be implemented are:
void add(index, element)
boolean addAll(index, Collection)
E get(index)
int indexOf(Object)
int lastIndexOf(Object)
ListIterator listIterator()
ListIterator listIterator(index)
E remove(index)
E set(index, element)
List<E> subList(from, to)
Overrides for removeIf(), replaceAll(), and sort() default methods should probably be implemented.
The new methods that need to be implemented are:
void add(index, element)
boolean addAll(index, Collection)
E get(index)
int indexOf(Object)
int lastIndexOf(Object)
ListIterator listIterator()
ListIterator listIterator(index)
E remove(index)
E set(index, element)
List<E> subList(from, to)
Overrides for removeIf(), replaceAll(), and sort() default methods should probably be implemented.
- relates to
-
JDK-6368844 (coll) Provide scalable double-ended lists
-
- Open
-
-
JDK-8033158 Eliminate inefficient use of ArrayList.remove in Scanner
-
- Open
-