Class YLongToLongMap


  • public class YLongToLongMap
    extends java.lang.Object
    Map which maps key of primitive type long to value of primitive type long.
    • Constructor Summary

      Constructors 
      Constructor Description
      YLongToLongMap()
      Creates an empty map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(long key)
      Checks whether map contains entry with given key.
      long get​(long key)
      Gets a value mapped by a given key.
      long getEmptyValue()
      Returns value which indicates that no value has been returned by put or get method.
      long put​(long key, long value)
      Puts a mapping between given key and given value to the map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • YLongToLongMap

        public YLongToLongMap()
        Creates an empty map.
    • Method Detail

      • getEmptyValue

        public long getEmptyValue()
        Returns value which indicates that no value has been returned by put or get method.
        Returns:
        "empty value"
        See Also:
        put(long, long), get(long)
      • put

        public long put​(long key,
                        long value)
        Puts a mapping between given key and given value to the map.
        Parameters:
        key - key of the mapping
        value - value of the mapping
        Returns:
        previous value of the key, or an empty value if there was no given key in the map.
        See Also:
        getEmptyValue()
      • get

        public long get​(long key)
        Gets a value mapped by a given key.
        Parameters:
        key - key of the mapping
        Returns:
        value associated with given key or an empty value if there is no given key in the map
      • containsKey

        public boolean containsKey​(long key)
        Checks whether map contains entry with given key.
        Parameters:
        key - key to check
        Returns:
        true if map contains mapping with given key, false otherwise