commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venkatesh Prasad Ranganath <comfortably007numb-pyt...@yahoo.com>
Subject Re: [Collections]: FilteredXxx Contribution
Date Sun, 27 Jun 2004 23:33:33 GMT
Venkatesh Prasad Ranganath wrote:
> Stephen Colebourne wrote:
> 
>> Do you mean you have a FilteredMap or a FilteredList? Both are quite 
>> useful
>>
>> I assume that it works by simply restricting those elements of the 
>> complete
>> map/list that can be seen?
>> And is it written as a decorator, extending AbstractList/MapDecorator?
>>
>>  
>>
> It is written as a decorator, but restriction is not as mentioned 
> above.  It is written in a way that it subsumes some of the 
> predicatedXXXX class behavior.  In simple words, a filtered map provides 
> a decorated "view" to the map and the view is editable, i.e., the user 
> can call dMap.clear() and all the objects that occur in that view (that 
> satisfy the predicate) will be deleted from the map.  All operations of 
> Collections are "filtered". To differentiate, PredicatedXXXX enable 
> controlled addition to the decorated collection whereas FilteredXXXX 
> enable controlled access and update to the decorated collection.

On pondering and implementing a little bit more, I think a FilteredCollection, FilteredCollectionIterator,
FilteredList, and 
FilteredMap should provide sufficient operations to view (read-only) a collection (Set, List,
Bag) and a map through a filter.

Comments?

-- 

Venkatesh Prasad Ranganath,
Dept. Computing and Information Science,
Kansas State University, US.
web: http://www.cis.ksu.edu/~rvprasad


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


Mime
View raw message