Class MiniMap<K,​V>

  • Type Parameters:
    K - the key type.
    V - the value type.
    All Implemented Interfaces:
    Composition

    public final class MiniMap<K,​V>
    extends Object
    implements Composition
    Straight forward minimal implementation of a strongly referencing identity hashing map.

    This implementation is preferable to full scale implementations like HashEnum or EqHashEnum in cases where only basic mapping functionality but best performance and low memory need is required, for example to associate handler instances to class instances.

    • Constructor Detail

      • MiniMap

        public MiniMap()
      • MiniMap

        public MiniMap​(int initialCapacity)
      • MiniMap

        public MiniMap​(int initialCapacity,
                       KeyValue<? extends K,​? extends V>... data)
    • Method Detail

      • size

        public int size()
      • get

        public V get​(K key)
      • containsKey

        public boolean containsKey​(K key)
      • put

        public V put​(K key,
                     V value)
      • remove

        public V remove​(K key)
      • optimize

        public void optimize()
      • clear

        public void clear()
      • iterateValues

        public int iterateValues​(Consumer<? super V> procedure)