generics fun
generics fun
- Subject: generics fun
- From: Lachlan Deck <email@hidden>
- Date: Tue, 22 Jul 2008 07:13:12 +1000
Hi there,
one of the things that frustrates me about generics is working with
collections. So I have a framework which has some stuff that deals
with the abstract entity types (with these entity types being
subclassed in the relevant application).
This leads to stupid stuff like this:
public class Thing {
public void addAll( NSArray<AbstractType> foo );
...
}
And in the application:
NSArray<ConcreteType> bar;// assume exists
thing.addAll( bar ); // -- complains to be not compatible and casting
fails
I can change addAll to take <? extends AbstractType> but then other
stuff fails and so on. How are others dealing with this stuff?
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden