A
List
implementation that is optimised for fast insertions and removals at any index in the list.
This list implementation utilises a tree structure internally to ensure that all insertions and removals are O(log n). This provides much faster performance than both an
ArrayList
and a
LinkedList
where elements are inserted and removed repeatedly from anywhere in the list.
The following relative performance statistics are indicative of this class:
get add insert iterate remove TreeList 3 5 1 2 1 ArrayList 1 1 40 1 40 LinkedList 5800 1 350 2 325
ArrayList
is a good general purpose list implementation. It is faster than
TreeList
for most operations except inserting and removing in the middle of the list.
ArrayList
also uses less memory as
TreeList
uses one object per entry.
LinkedList
is rarely a good choice of implementation.
TreeList
is almost always a good replacement for it, although it does use sligtly more memory.
@author Matt Hall, John Watkinson, Joerg Schmuecker
@author Stephen Colebourne
@version $Revision: 1.1 $ $Date: 2005/10/11 17:05:32 $
@since Commons Collections 3.1