1 2 3 4 | Iterator e = coll.elements(); Iterator panels = FilteringIterator(e, IsPanel); while (panels.more()) doSomethingWith(cast(Panel)(panels.get())); |
1 2 3 | class IsPanel : Predicate { bool predicate(Object v) { return cast(Panel) v !is null; } } |
See Also:
tango.util.collection.Predicate.predicateAuthor:
Doug Lea