Package org.fastily.jwiki.util
Class MultiMap<K,V>
java.lang.Object
org.fastily.jwiki.util.MultiMap<K,V>
- Type Parameters:
K
- The type of the keyV
- The type of the values, which will be stored in an ArrayList.
public class MultiMap<K,V> extends Object
A HashMap which allows multiple values for each key. Duplicate values are permitted.
- Author:
- Fastily
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MultiMap()
Constructor, creates an empty MapList. -
Method Summary
-
Field Details
-
l
The backing structure for this MapList. This is public because a getter would just return a reference to this anyways.
-
-
Constructor Details
-
MultiMap
public MultiMap()Constructor, creates an empty MapList.
-
-
Method Details
-
touch
Creates a new empty ArrayList fork
in this MapList if it did not exist already. Does nothing otherwise.- Parameters:
k
- The key to create a new entry for, if applicable.
-
put
Adds a key-value pair to this MapList.- Parameters:
k
- The key to addv
- The value to add
-
put
Merges an ArrayList of V objects into the value set for a given key.- Parameters:
k
- The key to usevl
- The list of values to merge.
-