Class ListMap.Node<K,​V>

    • Field Detail

      • key

        private final K key
      • value

        private final V value
    • Constructor Detail

      • Node

        Node​(K key,
             V value)
    • Method Detail

      • size

        public int size()
        Description copied from interface: Traversable
        Returns the size of the collection.

        Warning: infinite collections are possible, as are collections that require traversal to calculate the size.

        Specified by:
        size in interface Traversable<K>
        Overrides:
        size in class ListMap<K,​V>
      • size0

        private int size0​(ListMap<K,​V> cur,
                          int acc)
      • get

        public V get​(@NotNull
                     K key)
        Description copied from interface: Map
        Returns the value associated with the key or null if the no value exists with the key specified.
        Specified by:
        get in interface Map<K,​V>
        Overrides:
        get in class ListMap<K,​V>
      • put

        @NotNull
        public @NotNull ListMap<K,​V> put​(@NotNull
                                               K key,
                                               V value)
        Description copied from interface: Map
        Returns a map with the value specified associated to the key specified.

        If value already exists for the key, it will be replaced.

        Specified by:
        put in interface Map<K,​V>
        Overrides:
        put in class ListMap<K,​V>
      • remove

        @NotNull
        public @NotNull ListMap<K,​V> remove​(@NotNull
                                                  K key)
        Description copied from interface: Map
        Returns a map with the value associated with the key removed if it exists.
        Specified by:
        remove in interface Map<K,​V>
        Overrides:
        remove in class ListMap<K,​V>
      • containsKey

        public boolean containsKey​(@NotNull
                                   K key)
        Description copied from interface: Map
        Returns true if this map contains the specified key.
        Specified by:
        containsKey in interface Map<K,​V>
        Overrides:
        containsKey in class ListMap<K,​V>