Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #25853

Re: limitations on using enum as generic parameter

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109
Path csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <nospam@nowhere.com>
Newsgroups comp.lang.java.programmer
Subject Re: limitations on using enum as generic parameter
Date Tue, 08 Feb 2011 12:40:45 -0800
Organization A noiseless patient Spider
Lines 14
Message-ID <iis9oh$71p$1@news.eternal-september.org> (permalink)
References <76e9be77-f846-4559-82ec-1d774a8a6a0b@q36g2000yqn.googlegroups.com> <iis2c4$egq$1@news.eternal-september.org> <c93f15ae-9766-42f3-9bb0-18cea537e111@u14g2000vbg.googlegroups.com> <7119305a-64ef-4706-adc2-ad06fc2064bc@w19g2000yqa.googlegroups.com> <1b51d5bf-2de0-4133-baeb-03282cbeaccf@p16g2000vbo.googlegroups.com> <2d91a230-489b-48fe-b7cb-e282b967e714@n10g2000yqf.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 8 Feb 2011 20:40:49 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="xNuk9hcfiRBxrKloCKMgIg"; logging-data="7225"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ghdVlh3uhwwuDZFCoe2bqCVov+CnEl10="
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
In-Reply-To <2d91a230-489b-48fe-b7cb-e282b967e714@n10g2000yqf.googlegroups.com>
Cancel-Lock sha1:bFA6er4ejTFV8gUcs9HSkjC1q/Q=
Xref csiph.com comp.lang.java.programmer:25853

Show key headers only | View raw


On 2/8/2011 11:44 AM, dalamb@cs.queensu.ca wrote:

> I can switch to using an ArrayList, though.


You don't need to in this instance.  values() and getEnumConstants() 
both return an array of the proper type, so the dirty work has been done 
for you.

Actually, "don't mix arrays and generics" is far to strong.  There's no 
reason not to mix them.  There's only a couple of edge cases where you 
have to do funny things with compiler directives.  Your usage here is 
just fine.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: limitations on using enum as generic parameter "dalamb@cs.queensu.ca" <david.alex.lamb@gmail.com> - 2011-02-08 11:13 -0800
  Re: limitations on using enum as generic parameter Lew <lew@lewscanon.com> - 2011-02-08 11:22 -0800
    Re: limitations on using enum as generic parameter markspace <nospam@nowhere.com> - 2011-02-08 12:40 -0800
    Re: limitations on using enum as generic parameter "dalamb@cs.queensu.ca" <david.alex.lamb@gmail.com> - 2011-02-08 11:44 -0800

csiph-web