Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 09 Aug 2011 03:33:24 -0500 Date: Tue, 09 Aug 2011 01:33:25 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 15 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.203.65 X-Trace: sv3-QJxoh+In6GWZD5UszPb8I36sO6GpzVD6Y3jkzLivB6te2ume9ElaJ3ys6GWsgOaPZha8+jKHva+GSgJ!WBvf0C1/Dfeals6dtMgB3qr6e3BkXS12pNlRi70Z6cgoYPAYTuefnP0gtZxMTFxTwgzbxUuk+Lvy!selik7VebFNqT5g6NXswrmdhQNMA8UKvFNLU342+gjq+1A== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1769 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6901 On 8/8/2011 7:16 PM, Jan Burse wrote: ... > I actually do use setSize for a kind of sparse Vector. > Sparse in the sense that my Vector will have a couple > of holes represented by null value elements. Which > is eventually abuse of the term "sparse", but the use > case is there. ... If you only need small numbers of null elements, you could write a class extending ArrayList that has setSize(). All you would do is loop adding null elements or removing the tail elements until the ArrayList is the required size. Patricia