Chapter 3. Vectors and Hashtables

I originally intended to write a chapter on the collection framework discussing each and every collection. However, I could not get away from the 80–20 principle: 20 percent of the available data structures will be used 80 percent of the time. Since your time is valuable, I wanted to get straight to the point and discuss the two collections that I see most often in commercial code. These are Vector and Hashtable. I don't doubt that people are also using Stack and ArrayList and other fine collections, but the discussion of Vector and Hashtable performance issues will capture many of the generic principles underlying the other collections as well.

Optimization 17: Vector Add and Remove

The Vector public interface ...

Get Java™ Performance and Scalability, Volume 1: Server-Side Programming Techniques now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.