module Make:Functor building an implementation of the partial bijective hash table structure.
Parameters: |
|
type
key
type
elt
type
t
val length : t -> int
val create : int -> t
create n
is a new, empty bijective hash table with capacity
for n
entries.
Bihashtbl.S.length
(create n) = 0
val clear : t -> unit
val copy : t -> t
val mem : t -> key -> bool
mem b k
holds when there is an entry for k
in b
.val mem_inv : t -> elt -> bool
mem_inv b e
holds when an entry in b
maps some key to e
.val add : t -> key -> elt -> unit
add b k e
adds an entry mapping k
to e
to b
.
not (
Bihashtbl.S.mem
b k)
not (
Bihashtbl.S.mem_inv
b e)
Bihashtbl.S.mem
b k
Bihashtbl.S.mem_inv
b e
Bihashtbl.S.find
b k = e
Bihashtbl.S.find_inv
b e = k
val find : t -> key -> elt
val find_inv : t -> elt -> key
val remove_key : t -> key -> unit
val remove_elt : t -> elt -> unit
remove_key b y
removes any entry that maps to the element
e
from b
.
not (
Bihashtbl.S.mem_inv
b e)
val replace : t -> key -> elt -> unit
replace b k e
updates the entries in b
so that k
is
mapped to e
. This is functionally equivalent to
Bihashtbl.S.remove_key
b k
followed by
Bihashtbl.S.add
b k e
.
Bihashtbl.S.mem
b k
Bihashtbl.S.mem_inv
b e
Bihashtbl.S.find
b k = e
Bihashtbl.S.find_inv
b e = k
val iter : (key -> elt -> unit) -> t -> unit
iter c t
applies c
to every entry in b
. Applications
are made in increasing order with respect
Bihashtbl.S.key
.val fold : (key -> elt -> 'a -> 'a) -> t -> 'a -> 'a
fold f b a
is (f kN eN ... (f k1 e1 a) ... )
, where b
is
a collection of entries {(k1,e1) ... (kN,eN)}
ordered with
respect to Bihashtbl.S.key
.