jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes I need a suitable data structure! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I need a suitable data structure!" Watch "I need a suitable data structure!" New topic
Author

I need a suitable data structure!

Simon Halliday
Greenhorn

Joined: Apr 26, 2005
Posts: 2
I have to produce a JAVA top trumps game and need a data structure in which to store 'card' objects. It needs to be expandable (ruling out a conventional array) and I need to be able to shuffle the cards (ruling out a linked list). I have heard of a mythical array type that can be expanded and has a '.shuffle' method but can't find anything on it in my textbooks. If anyone can suggest a structure and give me a quick run-down on the syntax associated with it (or tell me where to look to find out about it) I would most grateful.
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
You'll have to travel to far off lands and battle dragons to find it, but java.util.ArrayList is the magic you seek. Some have even read in ancient mystic scrolls of an incantation to shuffle any List.
 
wood burning stoves
 
subject: I need a suitable data structure!
 
Similar Threads
Creating random Unique values
Need Help in java
data structures and databases
In need of a data structure!
Deck of cards