On Tue, Jul 22, 2008 at 1:13 AM, Lachlan Deck <[EMAIL PROTECTED]>
wrote:

> 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?


It seems that using bounded wildcard (<? extends AbstractType>) is right
solution. What sort of problem do you have with this code?


>
> with regards,
> --
>
> Lachlan Deck
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/shkutkov%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>



-- 
Cheers, Michael
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to