Java Associative Arrays (Sort Of)
Submitted by admin on Sat, 09/12/2015 - 2:29pmEver wish that Java had associative arrays (aka assoc arrays) like in PHP? As in, $x["name"] = "Bill" ? Well, I created a helper class for Java which comes close to approximating it. It can even loop through it similar to foreach().
I call the class PseudoAssocArray, because it actually uses a HashMap to do the behind the scenes work.
Click here to download the source file (CC BY 3.0 "Open Source" license)
Simply download and import the file in your project, then use it like so:

Programming from multiple computers is always a bit of a pain. What I used to do is keep all my source files on a USB drive, and just have to remember to carry it with me every where I go. I'm always worried about breaking or losing it, so I have to back it up frequently.
This is in stark contrast to, say, Microsoft Visual Basic / Visual Studio, where you can just drag and drop elements onto a form, and what you see is what you get. And when you double-click a button on your form, you get to the code which is executed when the button is clicked. In Java, if you want anything other than just the basics, you're going to have to do a lot of typing.
For those MySQL gurus out there, you're probably screaming "use transactions!" But, if you are using a MyISAM table instead of InnoDB, that isn't an option.