Package org.cdlib.mrt.utility
Class LinkedHashList<K,V>
java.lang.Object
org.cdlib.mrt.utility.LinkedHashList<K,V>
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Empty listReturn a list based on this keyint
Number of entries matching this keygetFirstElement
(K key) keySet()
Return a list of keys for this hashvoid
add element to list.int
size()
-
Field Details
-
hash
-
-
Constructor Details
-
LinkedHashList
public LinkedHashList() -
LinkedHashList
public LinkedHashList(int cnt)
-
-
Method Details
-
put
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 valuevalue
- value to be added
-
get
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
-
getCnt
Number of entries matching this key- Parameters:
key
- of list of entries- Returns:
- number of entries in list matching this key
-
keySet
Return a list of keys for this hash- Returns:
-
size
public int size()
-