Class HashMapList

java.lang.Object
com.mckoi.util.HashMapList

public class HashMapList extends Object
A HashMap that maps from a source to a list of items for that source. This is useful as a searching mechanism where the list of searched items are catagorised in the mapped list.
Author:
Tobias Downer
  • Constructor Details

    • HashMapList

      public HashMapList()
      Constructs the map.
  • Method Details

    • put

      public void put(Object key, Object val)
      Puts a value into the map list.
    • get

      public List get(Object key)
      Returns the list of values that are in the map under this key. Returns an empty list if no key map found.
    • remove

      public boolean remove(Object key, Object val)
      Removes the given value from the list with the given key.
    • clear

      public List clear(Object key)
      Clears the all the values for the given key. Returns the List of items that were stored under this key.
    • keySet

      public Set keySet()
      The Set of all keys.
    • containsKey

      public boolean containsKey(Object key)
      Returns true if the map contains the key.