in supercollider there are methods for comparing / intersect / find difference between etc arrays. i need to do similar operations in processing. are there any of those, for modifying arrays? or is there a different class (maybe from java) that allows such?
what i need: i will have a finite amount of ints. i want to move them in groups between 3 different arrays. for example, they are all in the first array, then i "move" (copy and remove) the first 100 ints to the second array, the from there the first 50 to the third array, then the first 20 back to the first array. every int can be inside of only one array at the same time, either first or second or third, never in two of the arrays.
can anybody give me a hint? thanks a lot, best regards!
Mmm, you describe only move operations, so it can be quite simple to do. But arrays in Java have fixed size. You don't "remove" items from them. The usual workaround is to make new arrays, smaller, and copy there the data you need to have. Processing offers an arrayCopy() method (wrapper around Java's System.arraycopy()) to do the copy quickly and painlessly.