Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: alias for Integer Date: Mon, 21 Nov 2011 20:58:22 +0100 Lines: 20 Message-ID: <9ivorbFcn7U1@mid.individual.net> References: <21374513.220.1321627842805.JavaMail.geo-discussion-forums@yqmj32> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net DIDgvu4mvD0t7gx7tN+pcgsrM2s9NfgPSlCxxyYZRkatleOK8= Cancel-Lock: sha1:Y7reYRBDEbVi+ZWUappSPBBbymw= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <21374513.220.1321627842805.JavaMail.geo-discussion-forums@yqmj32> Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10163 On 18.11.2011 15:50, jrobinss wrote: > public final class MatrixIndex { > public final int value; > public MyIndex(int i) {value = i;} > } I'd rather use Integer but if you want a specific type you could implement a class which inherits Number and works exactly same way Integer does and has a generic type parameter for the container type. While that type parameter would be otherwise useless it would help in catching type errors. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/