Well, this works, but seems like I'm reinventing the wheel.
NSMutableArray<Finished> descendantFinisheds = new
NSMutableArray<Finished>();
for (Part aPart : descendantParts()) {
if (aPart instanceof Finished) {
descendantFinisheds.addObject((Finished) aPart);
}
}
And if I can force the casting of one object, why can't I force the
casting of the Array using (NSArray<Finished>) EOQual...?
Filtering with a qualifier is a generic (uh .. not generic like
generics) implementation of this filtering, so it's impossible to
enforce the rule you're specifying statically. You are going to have
to cast somewhere. In your case, you're casting the objects inside
the array, but you should be able to cast the resultant array from the
original filter also. You may need to specify your original array as
NSMutableArray<? extends Part> instead of NSMutableArray<Part>, but
regardless you're going to have to cast somewhere in the chain to do
this.
ms
_______________________________________________
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]