Class Hashmmap.hashmultimap


class [['a, 'b]] hashmultimap : ?size:int -> unit -> object .. end
The hashmultimap class

val current : ('a, 'b) Hashtbl.t
The state of the hashmap.
method get : ('a, 'b) Hashtbl.t
method lookup_or_fail : 'a -> 'b list
Return all the objects bound to the given key, or raise Not_found:
method lookup : 'a -> 'b list
Return all the objects bound to the given key, or the empty list if no binding is found:
method mem : 'a -> 'b -> bool
Answer (quickly!) to the question if (x,y) is a member of the (multi) map.
method memq : 'a -> 'b -> bool
Answer (quickly!) to the question if (x,y) is a member of the (multi) map.
method bound : 'a -> bool
Answer if x is bound in the multi map.
method add : 'a -> 'b -> unit
Add a binding to a multi map.
method replace : 'a -> 'b -> unit
Replace or add (when not existing) a binding to a multi map.
method remove : ?all:bool -> 'a -> unit
Remove one or all (default) bindings of the given key.
method remove_key_value : 'a -> 'b -> unit
Remove the given <key, value> binding, if present; otherwise do nothing.
method remove_key_value_or_fail : 'a -> 'b -> unit
Remove the given <key, value> binding, if present; otherwise raise an exception.
method to_list : ('a * 'b) list
Make an alist from the map, returning the bindings as <key, value> pairs in some unspecified order.
method add_list : ('a * 'b) list -> unit
Add all the binding from the given alist to the map.