Class LinkedHashList<K,V>

java.lang.Object
org.cdlib.mrt.utility.LinkedHashList<K,V>
All Implemented Interfaces:
Serializable

public class LinkedHashList<K,V> extends Object implements Serializable
Specialized hash table that allows multiple entries on the same key. Useful for storing multiple key-value pairs that can be processed as a LinkedHashTable
Author:
dloy
See Also:
  • Field Details

  • Constructor Details

    • LinkedHashList

      public LinkedHashList()
    • LinkedHashList

      public LinkedHashList(int cnt)
  • Method Details

    • put

      public void put(K key, V value)
      add element to list. If key does not exist then add Vector associated with this key. If key does exist then append entry to Vectore
      Parameters:
      key - of associated value
      value - value to be added
    • get

      public Vector<V> get(K key)
      Return a list based on this key
      Parameters:
      key - of list to be returned
      Returns:
      list associated with this key
    • clear

      public void clear()
      Empty list
    • getFirstElement

      public V getFirstElement(K key)
    • getCnt

      public int getCnt(K key)
      Number of entries matching this key
      Parameters:
      key - of list of entries
      Returns:
      number of entries in list matching this key
    • keySet

      public Set<K> keySet()
      Return a list of keys for this hash
      Returns:
    • size

      public int size()