I
Ike
If I have a Vevtor:
Vector vector = new Vector();
and I am tracking a particular Object within that Vector, whereby I obtain
it;s original position within the Vector, say, int u. Then say, through
various Vector operations, the location of that particular Object is no
longer at u; Therefore, I periodically want to reset it back to being in
position u within the Vector.
Presently, I do this with :
vector.removeElement(myObject);
vector.insertElementAt(myObject, u);
But I am not so certain this is the "best" way to do this. My concern is
memory fragmentation, or, more generally, the ability for such a procedure
to run for days on end without this developing into a problem somehow.
Given that, is there a better way to accomplish what I am doing here?
Thanks, Ike
Vector vector = new Vector();
and I am tracking a particular Object within that Vector, whereby I obtain
it;s original position within the Vector, say, int u. Then say, through
various Vector operations, the location of that particular Object is no
longer at u; Therefore, I periodically want to reset it back to being in
position u within the Vector.
Presently, I do this with :
vector.removeElement(myObject);
vector.insertElementAt(myObject, u);
But I am not so certain this is the "best" way to do this. My concern is
memory fragmentation, or, more generally, the ability for such a procedure
to run for days on end without this developing into a problem somehow.
Given that, is there a better way to accomplish what I am doing here?
Thanks, Ike