Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Info about Vector

 
Abiodun Okusolubo
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Vector to hold reference object. If more objects are added to the vector or/and objects removed
can one guarantee that the positions of remaining objects still be arranged in such a way that objects are kept in sequence in which they were
before adding or removing objects.

Thanks
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day!
Well i suppose the Vector class has add(int index,Object o) since it implements the List Interface, so i suppose u could still reference the the object via the index of the object!But i would suggest using an ArrayList cause of the Overhead associated with it(would add a performance hit cause it is synchronised in Nature)!Anyways just a suggestion!Have a nice day!
 
Abiodun Okusolubo
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The need for vector is hold reference reference to JTable object, also, synchronization in vector does not play a significant part in performance in this case. My point is, after changing data in the vector how much does it affect the arrangement of this data arrangement. I read somewhere that object arrangement in Arraylist cannot be guaranteed especially when data has been added or removed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic