Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Thu, 11 Aug 2011 01:55:43 +0200 Organization: albasani.net Lines: 19 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net eLQBa4vB19gOq9Ht+Dthl/e1axO6/scLH1K63LgiLrSQH8HuXQ4qnjgF2e1mRKTOEmSIgWFrQ8h5x/UNgq2eKzHXEnMfz1i8XL5ZxJOe8bL2KE1gwXVUqyM+Ou23uNDQ NNTP-Posting-Date: Wed, 10 Aug 2011 23:55:47 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="0r4uhWq3CeRrtZmwm1S5/oaleQlKM9mFyT4q6oiR8dpxBZLIA/61ptzWj+EKvb+LRJvESTtI7ikxsGxOj0lPioFMOQV2y4wfjNrQcUkXxgDXV7JCUAILTKMNYZ8eJrcf"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2 In-Reply-To: Cancel-Lock: sha1:HaQ63YxNTtvnPoZoQ8CSd2+j5vE= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7000 Joshua Cranmer schrieb: > Okay, if you're so annoyed about the creation of several objects, you > can create your own version of a CopiesList that implements both > Collection and Iterator and implements everything on itself, for a > single overhead of around 12 bytes. If that is still too much, run a > garbage collection. You now have a few hundred extra kilobytes of data. > If you're still complaining, you're using the wrong language. > The language is fine, since it could have an efficient setSize(). Its not a problem of the Java language at all. And of course I could create also a clone of ArrayList and add setSize there. But I don't like the idea of copy/pasting the ArrayList implementation. Once you start implementing your own primitive classes your project reaches another dimension. But yes of course this is an option, if the out of the box "collections" do not fit. Bye