A type-specific array-based list; provides some additional methods that use polymorphism to avoid (un)boxing.
This class implements a lightweight, fast, open, optimized, reuse-oriented version of array-based lists. Instances of this class represent a list with an array that is enlarged as needed when new entries are created (by dividing the current length by the golden ratio), but is never made smaller (even on a {@link #clear()}). A family of {@linkplain #trim() trimming methods} lets you control the size of thebacking array; this is particularly useful if you reuse instances of this class. Range checks are equivalent to those of {@link java.util}'s classes, but they are delayed as much as possible. The backing array is exposed by the {@link #elements()} method.
This class implements the bulk methods removeElements()
, addElements()
and getElements()
using high-performance system calls (e.g., {@link System#arraycopy(Object,int,Object,int,int) System.arraycopy()} instead ofexpensive loops.
@see java.util.ArrayList