You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2003/11/07 23:46:05 UTC

[collections] MapIterator asMapEntry method

The MapIterator interface has an asMapEntry() method that gets the current
element at the iterator as a Map Entry.

The interface desires that the MapEntry returned is connected to the map,
such that changes made to setValue affect the map. This can be difficult to
implement, and if used would probably mess up the iterator.

How useful is the asMapEntry() method? I'm planning to remove it if no one
objects :-)

Stephen


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


Re: [collections] MapIterator asMapEntry method

Posted by __matthewHawthorne <ma...@phreaker.net>.
+1.

I don't really see the point of the asMapEntry() method either.  If 
someone wants the entries, they could just do it the old fashioned way 
[Map.entrySet().iterator()].




Stephen Colebourne wrote:
> The MapIterator interface has an asMapEntry() method that gets the current
> element at the iterator as a Map Entry.
> 
> The interface desires that the MapEntry returned is connected to the map,
> such that changes made to setValue affect the map. This can be difficult to
> implement, and if used would probably mess up the iterator.
> 
> How useful is the asMapEntry() method? I'm planning to remove it if no one
> objects :-)
> 
> Stephen


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