Package org.apache.commons.collections4.map


package org.apache.commons.collections4.map
This package contains implementations of the Map, IterableMap, OrderedMap and SortedMap interfaces. A Map provides a lookup from a key to a value. A number of implementations also support the new MapIterator interface that enables simple iteration of map keys and values.

The following implementations are provided:

  • CaseInsensitiveMap - map that compares keys in a case insensitive way
  • CompositeMap - map that combines multiple maps into a single view
  • HashedMap - general purpose HashMap replacement supporting MapIterator
  • Flat3Map - designed for good performance at size 3 or less
  • LinkedMap - a hash map that maintains insertion order, supporting OrderedMapIterator
  • LRUMap - a hash map that maintains a maximum size by removing the least recently used entries
  • MultiKeyMap - map that provides special methods for using more than one key to access the value
  • ReferenceMap - allows the garbage collector to collect keys and values using equals() for comparison
  • ReferenceIdentityMap - allows the garbage collector to collect keys and values using == for comparison
  • SingletonMap - a fully featured map to hold one key-value pair
  • StaticBucketMap - internally synchronized and designed for thread-contentious environments

The following decorators are provided:

  • Unmodifiable - ensures the collection cannot be altered
  • Predicated - ensures that only elements that are valid according to a predicate can be added
  • Transformed - transforms each element added
  • FixedSize - ensures that the size of the map cannot change
  • Defaulted - provides default values for non-existing keys
  • Lazy - creates objects in the map on demand
  • ListOrdered - ensures that insertion order is retained
  • Class
    Description
    An abstract implementation of a hash-based map which provides numerous points for subclasses to override.
    Provide a basic IterableMap implementation.
    An abstract implementation of a hash-based map that links entries to create an ordered map and which provides numerous points for subclasses to override.
    Provides a base decorator that enables additional functionality to be added to a Map via decoration.
    Provides a base decorator that enables additional functionality to be added to an OrderedMap via decoration.
    An abstract implementation of a hash-based map that allows the entries to be removed by the garbage collector.
    Reference type enum.
    Provides a base decorator that enables additional functionality to be added to a Map via decoration.
    A case-insensitive Map.
    Decorates a map of other maps to provide a single unified view.
    This interface allows definition for all of the indeterminate mutators in a CompositeMap, as well as providing a hook for callbacks on key collisions.
    Decorates another Map returning a default value if the map does not contain the requested key.
    Adapts a Map entrySet to the MapIterator interface.
    Decorates another Map to fix the size, preventing add/remove.
    Decorates another SortedMap to fix the size blocking add/remove.
    A Map implementation that stores data in simple fields until the size is greater than 3.
    A Map implementation that is a general purpose alternative to HashMap.
    LazyMap<K,V>
    Decorates another Map to create objects in the map on demand.
    Decorates another SortedMap to create objects in the map on demand.
    A Map implementation that maintains the order of the entries.
    Decorates a Map to ensure that the order of addition is retained using a List to maintain order.
    LRUMap<K,V>
    A Map implementation with a fixed maximum size which removes the least recently used entry if an entry is added when full.
    A Map implementation that uses multiple keys to map the value.
    Deprecated.
    since 4.1, use MultiValuedMap instead
    Decorates a Map to evict expired entries once their expiration time has been reached.
    A ExpirationPolicy that returns a expiration time that is a constant about of time in the future from the current time.
    A policy to determine the expiration time for key-value entries.
    Decorates another Map to validate that additions match a specified predicate.
    Decorates another SortedMap to validate that additions match a specified predicate.
    A Map implementation that allows mappings to be removed by the garbage collector and matches keys and values based on == not equals().
    A Map implementation that allows mappings to be removed by the garbage collector.
    A Map implementation that holds a single item and is fixed size.
    A StaticBucketMap is an efficient, thread-safe implementation of java.util.Map that performs well in in a highly thread-contentious environment.
    Decorates another Map to transform objects that are added.
    Decorates another SortedMap to transform objects that are added.
    Decorates a map entry Set to ensure it can't be altered.
    Decorates another Map to ensure it can't be altered.
    Decorates another OrderedMap to ensure it can't be altered.
    Decorates another SortedMap to ensure it can't be altered.