> > Though that does raise the question: if you wrap a list that has 
> > preexisting elements that are invalid, how should that be 
> > handled (if 
> > at all)?
> 
> I throw an IllegalArgumentException in the constructor. I 
> wanted to be able to rely on the object.

Sounds reasonable to me.

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: Stephen Colebourne [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, April 23, 2002 4:51 PM
> To: Jakarta Commons Developers List
> Subject: Re: [Collections][SUBMIT] TypedList
> 
> 
> From: Tim Moore <[EMAIL PROTECTED]>
> > Well if you think of this as a list proxy with no backing 
> store of its 
> > own, then IMO it makes sense to think of the parameter as the 
> > collection to delegate to instead of to copy items out of.  I feel 
> > like this is still in keeping with the spirit of the Collection 
> > javadoc, which didn't really consider collection proxies.
> 
> > If you really want to copy the items from another Collection, you 
> > would pass it to the constructor of the list that you're wrapping.
> 
> Yes, overall, perhaps I do agree with this.
> 
> > Though that does raise the question: if you wrap a list that has 
> > preexisting elements that are invalid, how should that be 
> handled (if 
> > at all)?
> 
> I throw an IllegalArgumentException in the constructor. I 
> wanted to be able to rely on the object.
> 
> Stephen

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to