Class LongMapWrapperImpl<V>

    • Constructor Detail

      • LongMapWrapperImpl

        public LongMapWrapperImpl​(Map<Long,​V> mapToWrap,
                                  Function<V,​Long> valueToKey)
        Constructor
        Parameters:
        mapToWrap - the map to wrap
        valueToKey - function to map a value to its key
      • LongMapWrapperImpl

        public LongMapWrapperImpl​(LongMapWrapperImpl<V> other)
        Copy constructor
        Parameters:
        other - to copy
    • Method Detail

      • remove

        public V remove​(long key)
        Remove value from map by the long key
        Specified by:
        remove in interface LongMapWrapper<V>
        Parameters:
        key - to remove
        Returns:
        removed entry if any
      • get

        public V get​(long key)
        Collect entry from container using primitive
        Specified by:
        get in interface LongMapWrapper<V>
        Parameters:
        key - to use
        Returns:
        value found
      • containsKey

        public boolean containsKey​(long key)
        Verify if entry is present
        Specified by:
        containsKey in interface LongMapWrapper<V>
        Parameters:
        key - to use
        Returns:
        true when present, false otherwise
      • clone

        public abstract LongMapWrapperImpl<V> clone()
        Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created
        Specified by:
        clone in interface MapWrapper<Long,​V>
        Overrides:
        clone in class MapWrapperImpl<Long,​V>
        Returns:
        copy