Adds a single key -> value pair to the map, with time complexity of O(n*log(n)) due to sorting the new entry by its key.
Gets this multivalue map as an associative array, where each key is mapped to a list of values.
Clears this map of all values.
Determines if this map contains a value for the given key.
Gets all values associated with a given key, allocated in a new array.
Gets the first value associated with a given key, as per the order in which the values were inserted.
Gets a list of all keys in this map, allocated in a new array.
Gets the number of unique keys in this map.
opApply implementation to allow iterating over this map by all pairs of keys and values.
Implements opBinaryRight for the "in" operator, such that k in m will resolve to the list of values for key k in the multivalue map m if that key exists, or null if not.
Implements the empty index operator, which just returns the entire list of entries in this map.
Convenience overload to get the first value for a given key. Note: this will throw an exception if no values exist for the given key. To avoid this, use getFirst and deal with the missing value yourself.
Removes a key from the map, thus removing all values associated with that key.
Converts this map into a human-readable string which lists each key and all of the values for that key.
Constructs a multivalued map from an associative array.
Constructs a multivalued map from an associative array of single values.
A multi-valued mapping, where a key is mapped to one or more values. The map is sorted by keys for O(log(n)) lookup and retrieval, and O(n*log(n)) insertion.
KeyType is the type used for the map's keys. ValueType is the type used for the map's values. KeySort is a function that takes two operands and returns true if the first one is less than the second. KeyEquals is a function that takes two operands and returns true if they are equal.