Campbell Ritchie wrote:You should not start worrying about searching thirty objects; even the most inefficient search will run quickly for so few. Once you have 30000000 objects, then you will find out whether your search algorithm is working correctly.
What do you know about search algorithms? Do you know which run in constant time, which in logarithmic time, which in linear time and which in quadratic time?
You should consider the following factors before searching:-
How often and you are going to run the search? How often are you going to add things to your collection? How long will it take to sort it?
Have you been through the Java™ Tutorials about collections? That might tell you something about searching.
Paul Clapham wrote:
Montana Burr wrote:In Java, I feel like creating a subclass of JFrame just to accomplish what I set out to accomplish isn't a very good idea.
Yes, your intuition about GUI design is absolutely correct. You shouldn't create a subclass of JFrame to be your controller. Unfortunately you'll see a lot of bad Swing code which does exactly that, including code which is generated by various widely-known Java tools.
So yes, you should create a separate class which acts as the controller. That code should contain a reference to the JFrame, or at least to the GUI components which it controls, but it shouldn't BE a JFrame.
Jesper de Jong wrote:
What is exactly the purpose of this _MultikeyMap trait? A normal Map can also have multiple keys that refer to the same value, you don't need a special Map implementation for that.