File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

order in a collection

 
Matthew Phillips
Ranch Hand
Posts: 2676
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for a Collection that guarentees that the order in which I place objects will be maintained. Does anyone have any suggestions?
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind. It looks like an ArrayList will fit my needs perfectly.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all collections that use the List interace accomplish just that. ArrayList is the best one in my opinon too although LinkedList does the same.
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Roy Ben Ami:
all collections that use the List interace accomplish just that. ArrayList is the best one in my opinon too although LinkedList does the same.

Right. I decided on the ArrayList because I am not going to be inserting objects in the beginning or deleting objects from an iterator. It has been awhile since I have worked with any of the Collections so I couldn't remember which interface featured guaranteed order.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic