Interface IterableMap

All Superinterfaces:
Map
All Known Subinterfaces:
BidiMap, OrderedBidiMap, OrderedMap, SortedBidiMap
All Known Implementing Classes:
AbstractBidiMapDecorator, AbstractDualBidiMap, AbstractHashedMap, AbstractLinkedMap, AbstractOrderedBidiMapDecorator, AbstractOrderedMapDecorator, AbstractReferenceMap, AbstractSortedBidiMapDecorator, CaseInsensitiveMap, DualHashBidiMap, DualTreeBidiMap, Flat3Map, HashedMap, IdentityMap, LinkedMap, ListOrderedMap, LRUMap, MultiKeyMap, ReferenceIdentityMap, ReferenceMap, SingletonMap, TreeBidiMap, UnmodifiableBidiMap, UnmodifiableMap, UnmodifiableOrderedBidiMap, UnmodifiableOrderedMap, UnmodifiableSortedBidiMap

@Deprecated(since="2021-04-30") public interface IterableMap extends Map
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Defines a map that can be iterated directly without needing to create an entry set.

A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or cast to Map Entry objects.

  IterableMap map = new HashedMap();
  MapIterator it = map.mapIterator();
  while (it.hasNext()) {
    Object key = it.next();
    Object value = it.getValue();
    it.setValue("newValue");
  }
  
Since:
Commons Collections 3.0
  • Method Details

    • mapIterator

      MapIterator mapIterator()
      Deprecated.
      Obtains a MapIterator over the map.

      A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or cast to Map Entry objects.

       IterableMap map = new HashedMap();
       MapIterator it = map.mapIterator();
       while (it.hasNext()) {
         Object key = it.next();
         Object value = it.getValue();
         it.setValue("newValue");
       }
       
      Returns:
      a map iterator