Name: rm29839 Date: 06/09/98 The ArrayList class in the new collections framework is not useful (in the way that the Vector class is) for implementing *sparse*, variable-size arrays. The documentation says that the add(int index, Object element) method throws an IndexOutOfBounds exception when (index < 0 || index > size()). This is fine, except that there is no setSize(int newSize) method available. A developer can increase the capacity of the ArrayList, but he change the actual size, as he can with a Vector. I don't want to use a Map type, because the sequence of elements in the list -- and of those *not* in the list -- is important. In other words, I want to be able to insert elements into the list in any order and at any indices, then index the list at positions 0 through (size() - 1) and get a null back where I did not insert a value. (Review ID: 33274) ======================================================================
|