On 19 February 2013 10:27, Weijun Wang <weijun.w...@oracle.com> wrote: > I'm using LinkedList to maintain a history
Don't use LinkedList. Multiple benchmarks down the years have shown it is almost always worse than ArrayList. Stephen > and the elements are ordered by > their timestamps. Every now and then I would "expunge" the list, that is to > say, iterating through the list and when an element is old enough all > elements after (and including) it will be removed. Currently I'm removing > them one by one. > > Is there a way to truncate the list using a single method? > > Thanks > Max