Re: [Clirr-devel] Proposal: CoIterator class
Status: Alpha
Brought to you by:
lkuehne
From: <lak...@t-...> - 2004-06-13 06:10:32
|
When I started Clirr, I wanted to build the check modules as visitors, as the visitor pattern has worked out great over at Checkstyle - the individual modules/checks would be totally independent (very much unlike the current code in MethodSetCheck). My only problem was: How do you apply the Visitor pattern to walk two trees in parallel. Your CoIterator approach is a great first step into that direction, so +1 from me. Lars Simon Kitching wrote: >Kiora! > >Attached is a class I would like to add to the framework dir for >iterating over two collections of objects, returning "pairs" of equal >items (and pairs with one element set to null for items in either set >without an equivalent item in the other set). > >This can be used for iterating over two sets of JavaClass objects, or >two sets of Field objects, or two sets of Method objects, etc. > >I would like to then update existing code which implements this >functionality in many of the checks to use the CoIterator instead. To >show how this works, attached is an updated AddedClassCheck class. > >All feedback welcome. > >Regards, > >Simon > > > |