08 January 2005 - java_dev (original) (raw)

06:56 pm - matthias382 - Looking for a Good Data Structure I need a container data structure that meets the following criteria.1) Ordered by element insertion, first in first out2) Two-way iteration3) Iterator can be reset to point to the first element4) Elements can be accessed individually via a unique IDIt seems like a LinkedHashMap would work well, except for the fact that it will only return a plain Iterator from the values() method, and that only works for one-way iteration, not to mention that (as far as I know) the Iterator can't be reset to point to the first element.Any suggestions? I'd like to try to keep this relatively simple. No need to reinvent the wheel, eh? ;)