commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack, Paul" <>
Subject RE: [Collections][SUBMIT] TypedList
Date Tue, 23 Apr 2002 20:42:19 GMT
> 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));


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message