Wouldn't it be more generic to expose your (private inner) ClassPredicate as a public Predicate, say InstanceOfPredicate? That way one could easily create ClassFilterIterator, as you have, but could also use the Predicate in the various CollectionUtils methods, etc.
Also, I wonder if the ClassPredicate constructor should default to Object.class when the given Class is null. new ClassPredicate(null) or new ClassFilterIterator(null) seems like a rather confusing way to create a NotNullPredicate or a NotNullIterator. I wonder if simply throwing IllegalArgumentException or NullPointerException from the constructor would be cleaner? On Tue, 10 Dec 2002, Emmanuel Bourg wrote: > Hi, here is a suggested addition to the collections component. This is a > trivial FilterIterator which only returns objects of a given class. I > attached the class with its associated test case. > > Emmanuel Bourg > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
