java - Opinion on best Data structure for sorting Objects by type, which are non-sequential Integers? -
I will make it as simple as possible:
I have an ArrayList (person class) of objects. There are many variables in the objects, one of which is called the reps. To paint the scene picture, I want to sort these objects into buckets, where each bucket is a separate repad (they are not sequential, so it can be 1,2,5,7,8. .) Therefore, all the objects are stored in the same residual same redid. Why is the reason why I want to call DB for each representative. I want to sort them by redial, then repair Only receive information once dB, then operation using again and description of DB through all objects involved in the rape.
I was thinking of something like 2 dimensional ArrayList, the first dimension is based on integer numbers and the second dimension is individual objects, although I do not know how big the second dimension is. I will create the shape of the first dimension on the basis of the basic structure of the persons, then I want to add each object to the object, because they are sorted. Obviously, the size of the second dimension will be different for each
Looking for opinions whether it is a good way or not, and to make it completely 2-dimensional array, make sure about the syntax is not.
Looks like a good candidate for someone, where Kashmir is your representative, and V person Your array type will be a person.
Comments
Post a Comment