cloister wrote on Mar 31st, 2009, 10:43am:Oh, for the love of pete!
Thanks, guys. That worked.
But man, if I may rant for a second, that's astonishingly lame. Having two different kinds of integer, depending on whether they're boxed or not Gimme a break.
Any idea if/when we're ever going to get real generic collection classes in Processing
It really isn't "lame" there's very good reasons for there being 2 versions. The main one is: speed. The primitive "int" is the thing a processor understands.. it's a set of bits which it can directly address, do maths on and ship around, and so is what you'll use normally. It's not "pure" where everything is an Object, but it is necessary to make things run fast.
But it's not an Object, it has no methods, can't be pointed at by two variables etc, so there's the Object version. And to save every single class ever written to handle generic things have to have 8 extra versions of each method for the 8 primitive types, there are Object types of the primitives, so you only ever need to know how to handle an Object if you don't care what exactly is in it.
So you have the ease of use of an ArrayList, you just have to wrap the int into an Integer