Functions for working with IntegerMaps specifically: an efficient, persistent data structure mapping longs to objects. See also bifurcan-clj.map for general-purpose map operations.
Functions for working with IntegerMaps specifically: an efficient, persistent data structure mapping longs to objects. See also bifurcan-clj.map for general-purpose map operations.
(ceil-index m k)
The index of the entry whose key is either equal to key, or just above it. If key is greater than the maximum value in the map, returns null.
The index of the entry whose key is either equal to key, or just above it. If key is greater than the maximum value in the map, returns null.
(comparator m)
The comparator of this map.
The comparator of this map.
(contains? m k)
Does the given map contain a key?
Does the given map contain a key?
(entries m)
Returns a list of entries in the map.
Returns a list of entries in the map.
(floor-index m k)
The index of the entry whose key is either equal to key, or just below it. If key is less than the minimum value in the map, returns null.
The index of the entry whose key is either equal to key, or just below it. If key is less than the minimum value in the map, returns null.
(from x)
Constructs an map from another collection. Can take a Bifurcan map, a Bifurcan list of Bifurcan Entries, or an iterable of anything that can be coerced to an Entry--Clojure map entries, [k v] vector pairs, or Bifurcan entries.
Constructs an map from another collection. Can take a Bifurcan map, a Bifurcan list of Bifurcan Entries, or an iterable of anything that can be coerced to an Entry--Clojure map entries, [k v] vector pairs, or Bifurcan entries.
(get m k)
(get m k not-found)
Gets a key from a map. Returns the value, or nil if not found. Can take an explicit not-found value.
Gets a key from a map. Returns the value, or nil if not found. Can take an explicit not-found value.
(index-of m k)
Returns the Long index of a key, if present, or nil.
Returns the Long index of a key, if present, or nil.
(put m k v)
(put m k v merge)
Sets a key to a value. Optionally takes a function (merge current-val new-val) to combine an existing value.
Sets a key to a value. Optionally takes a function (merge current-val new-val) to combine an existing value.
(slice m min max)
A map representing all entries within [min max] inclusive.
A map representing all entries within [min max] inclusive.
(update m k f)
(update m k f a)
(update m k f a b)
(update m k f a b & more)
Updates a key by applying a function to the current value, or nil if it does not exist.
Updates a key by applying a function to the current value, or nil if it does not exist.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close