commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [Collections][SUBMIT] TypedList
Date Wed, 24 Apr 2002 08:39:43 GMT
+1. I think Stephen mentioned this too. I like the static factory method to
create typesafe lists.

James
----- Original Message -----
From: "Jack, Paul" <pjack@sfaf.org>
To: "'Jakarta Commons Developers List'" <commons-dev@jakarta.apache.org>
Sent: Tuesday, April 23, 2002 9:42 PM
Subject: RE: [Collections][SUBMIT] TypedList


> > PredicatedList would just take a Predicate in its constructor, and
> > anytime someone adds an element it throws an exception if the
> > predicate's evalute method returns false on the element.  Then when
> > TypedList extends PredicatedList it becomes a very small class that
> > simply constructs a TypeCheckPredicate and passes it to its superclass.
>
> I wouldn't even have a subclass for TypedList; I'd just put a static
> convience method in the TypeCheckPredicate class:
>
>     static List getTypeCheckedList(List list, Class type)
>     {
>          return new PredicateList(list, new TypeCheckPredicate(type));
>     }
>
> -Paul
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message