Grouping elements in an arrayList
in
Programming Questions
•
1 year ago
Hello all,
I am still struggling with my arrayList.
At the moment I wonder how can I group elements in an arrayList.
Let's assume I have a couple of lines with their vectors stored in an arrayList. I now want them to be treated together. For example if I want to move them right or left or rotate them.
Problem is that after and before the say 30 Lines there is other stuff in the arrayList that doesn't belong to the group.
I need to store the beginning and the end index of my Group. But where? In the same arrayList as a new element? Or with each member of the group? So it knows where it belongs? Or in another arrayList?
What happens when I delete one member of the group or one member of the arrayList before the group? The start and stop indices of the group would have to be redefinded?
What are cooler solutions for grouping?
Cheers, Chrisir
1