All Implemented Interfaces:
Iterable<Pair<K,V>>, Map<K,V>, Traversable<Pair<K,V>>, Iterable<Pair<K,V>>
Enclosing class:
ListMap<K,V>

class ListMap.Node<K,V> extends ListMap<K,V>
  • Field Details

    • key

      private final K key
    • value

      private final V value
  • Constructor Details

    • Node

      Node(K key, V value)
  • Method Details

    • 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)
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Traversable
      Returns true if this collection is empty.
      Specified by:
      isEmpty in interface Traversable<K>
      Overrides:
      isEmpty in class ListMap<K,V>
    • 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>
    • apply0

      private ListMap<K,V> apply0(ListMap<K,V> cur, K key)
    • tail

      public ListMap<K,V> tail()
      Overrides:
      tail 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>
    • getKey

      protected K getKey()
      Overrides:
      getKey in class ListMap<K,V>
    • getValue

      protected V getValue()
      Overrides:
      getValue 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>