I'm thinking of coding a program which will deal with many objects that i will wrap in a class. Since i will be adding, removing getting a specific one, checking if it's contained, and iterating through all of them, or just some selected ones, i would like to know which type of array or list should i use, so i can still have a nice performance. My first thought was to use ArrayList, but i'm guessing performance will be low once i reach a big number of objects. So, any sugestions on what would be best to use?
I.m building it tile by tile, because of the non-periodicity of the resulting tiling.
I want it to be really stable and accurate, because i need a scalable output (pdf) so i can use it high resolution. So i thought of using a pure math definition for every tile ( each one is comprised of a series of sides (lines with different angles) and other parameters), in a customised L-System configuration, and a system of tiling that didn't really need an (x,y) position for all the tiles,but just for one.
So first tile laid down is the "anchor", pinned to an (x,y), the next tiles being linked to the previous ones, depending on the sides they meet up. Maybe is just better to say it like this: 0 is the anchor tile, 1 comes on sides[1] of 0 ( which is called in my program the 'parentTile' of 1), 2 comes on side[3] of 1 and so on. I think i did pretty ok so far.
My problem starts when i'm trying to copy tiles and groups of tiles. Let's say i want to copy half of the tiling i've built so far because it creates a particular formation that i want to use more than once. I make a selection and thus i need 2 anchor tiles, to support the adjoining rest. I perform an algorithm to split the tiling, and based on the tileNumber, i choose the smallest tileNumber of the group to act like an anchor, and then, from smallest to biggest tileNumber, dictating to each tile who would their parentTile be. For obvious reasons, this algorithm is not bullet proof. And since all my diggings in the interwebs dind't show me a cleverer way to do this (the splitting algorithm) or the whole tiling programming, I ask kindly for some.....or any advice on the matter. Any info on the subject is really welcomed!