Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12248
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!gegeweb.org!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Steven Simpson <ss@domain.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Hairy generics question |
| Date | Wed, 22 Feb 2012 08:31:58 +0000 |
| Organization | Aioe.org NNTP Server |
| Lines | 91 |
| Message-ID | <uole19-a24.ln1@s.simpson148.btinternet.com> (permalink) |
| References | <3c65271e-a388-49c9-bcc6-ca3bf274e74f@e27g2000vbu.googlegroups.com> <v2Y0r.9874$yb.2452@newsfe20.iad> |
| NNTP-Posting-Host | SYma/1Oij9bhI+errvtPhg.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12248 |
Show key headers only | View raw
On 22/02/12 02:04, Daniel Pitts wrote:
> I think what you'll need to do is have generic parameter to CompA:
>
> public class CompA<View extends CompItemViewInterface<AInfo,
> CompA<View>, View>> extends CompItem<AInfo, CompA<View>, View>
I think you then have to do the same for your AInfo, with corresponding
changes to CompA's declaration:
class CompA<View extends CompItemViewInterface<AInfo<View>,
CompA<View>, View>>
extends CompItem<AInfo<View>, CompA<View>, View> { }
class AInfo<View extends CompItemViewInterface<AInfo<View>,
CompA<View>, View>>
extends CompItemInfo<AInfo<View>, CompA<View>, View> { }
For the interested, here's an SSCCE, with CompC as the special case, and
CompA and CompB defined as before (and a few bits guessed):
interface CompWidget<T> { }
class CompItemInfo
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>> { }
interface CompItemViewInterface
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>> { }
abstract class AbstractCompItem
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>> { }
abstract class CompItem
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>>
extends AbstractCompItem<T, P, V>
implements CompWidget<T> { }
class CompItemView
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>>
extends AbstractCompItemView<T, P, V>
implements CompItemViewInterface<T, P, V> { }
abstract class AbstractCompItemView
<T extends CompItemInfo<T, P, V>,
P extends AbstractCompItem<T, P, V>,
V extends CompItemViewInterface<T, P, V>> { }
class CompA extends CompItem<AInfo, CompA, CompAView> { }
class AInfo extends CompItemInfo<AInfo, CompA, CompAView> { }
class CompAView implements CompItemViewInterface<AInfo, CompA, CompAView> { }
class CompB extends CompItem<BInfo, CompB, CompBView> { }
class BInfo extends CompItemInfo<BInfo, CompB, CompBView> { }
class CompBView implements CompItemViewInterface<BInfo, CompB, CompBView> { }
class CompC<View extends CompItemViewInterface<CInfo<View>,
CompC<View>, View>>
extends CompItem<CInfo<View>, CompC<View>, View> { }
class CInfo<View extends CompItemViewInterface<CInfo<View>,
CompC<View>, View>>
extends CompItemInfo<CInfo<View>, CompC<View>, View> { }
--
ss at comp dot lancs dot ac dot uk
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Hairy generics question sclaflin <steve@steveclaflin.com> - 2012-02-21 06:30 -0800
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-21 09:24 -0800
Re: Hairy generics question Roedy Green <see_website@mindprod.com.invalid> - 2012-02-21 11:05 -0800
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-21 12:09 -0800
Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-21 18:04 -0800
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-21 18:31 -0800
Re: Hairy generics question Steven Simpson <ss@domain.invalid> - 2012-02-22 08:31 +0000
Re: Hairy generics question sclaflin@webucator.com - 2012-02-24 11:12 -0800
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-24 12:03 -0800
Re: Hairy generics question sclaflin@webucator.com - 2012-02-24 14:07 -0800
Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-24 15:36 -0800
Re: Hairy generics question sclaflin@webucator.com - 2012-02-25 10:27 -0800
Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-26 13:13 -0400
What is Model View Presenter. (Was: Hairy generics question) Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-26 10:22 -0800
Re: What is Model View Presenter. (Was: Hairy generics question) Lew <noone@lewscanon.com> - 2012-02-26 13:08 -0800
Re: What is Model View Presenter. (Was: Hairy generics question) Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 18:17 -0500
Re: What is Model View Presenter. (Was: Hairy generics question) sclaflin@webucator.com - 2012-02-28 06:22 -0800
Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-28 09:46 -0800
Re: Hairy generics question Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-02-28 09:49 -0800
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-28 12:45 -0800
Re: Hairy generics question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-29 19:37 -0400
Re: Hairy generics question Lew <noone@lewscanon.com> - 2012-02-29 22:32 -0800
csiph-web