Class LinkedListSortedMap<K,V>

Type Parameters:
K - the type of keys in the map.
V - the type of values in the collections mapped to the keys.
All Implemented Interfaces:
Serializable, Iterable<V>, CollectionMap<K,V>, CollectionSortedMap<K,V>

public class LinkedListSortedMap<K,V> extends AbstractCollectionSortedMap<K,V>
A sorted map whose values are linked lists of a given component type.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • LinkedListSortedMap

      public LinkedListSortedMap()
      Default constructor.
    • LinkedListSortedMap

      public LinkedListSortedMap(Comparator<K> comparator)
      Initialize this collection sorted map with the specified comparator.
      Parameters:
      comparator - comparator used to sort the keys.
  • Method Details

    • newCollection

      protected Collection<V> newCollection()
      Description copied from class: AbstractCollectionMap
      Create a new collection of values for insertion into the map.
      Specified by:
      newCollection in class AbstractCollectionMap<K,V>
      Returns:
      a new mutable empty collection.
    • moveToEndOfList

      public void moveToEndOfList(K key, V value)
      Look up the specified value in thel ist corresponding to the specified key and move it to then end of the list.
      Parameters:
      key - the key for which to look up in the corresponding list.
      value - the value to look up.