CLJS
basic-lein-cljs.core
cljs.analyzer
cljs.compiler
CLJS
cljs.core
CLJS
cljs.core.async
CLJS
cljs.core.async.impl.buffers
CLJS
cljs.core.async.impl.channels
CLJS
cljs.core.async.impl.dispatch
CLJS
cljs.core.async.impl.ioc-helpers
CLJS
cljs.core.async.impl.protocols
CLJS
cljs.core.async.impl.timers
cljs.env
cljs.externs
CLJS
cljs.js
cljs.js-deps
CLJS
cljs.pprint
CLJS
cljs.reader
CLJS
cljs.repl
cljs.source-map
CLJS
cljs.source-map
cljs.source-map.base64
CLJS
cljs.source-map.base64
cljs.source-map.base64-vlq
CLJS
cljs.source-map.base64-vlq
CLJS
cljs.spec.alpha
CLJS
cljs.spec.gen.alpha
cljs.tagged-literals
CLJS
cljs.tools.reader
CLJS
cljs.tools.reader.edn
CLJS
cljs.tools.reader.impl.commons
CLJS
cljs.tools.reader.impl.errors
CLJS
cljs.tools.reader.impl.inspect
CLJS
cljs.tools.reader.impl.utils
CLJS
cljs.tools.reader.reader-types
cljs.util
clojure.core
clojure.core.async
clojure.core.async.impl.buffers
clojure.core.async.impl.channels
clojure.core.async.impl.concurrent
clojure.core.async.impl.dispatch
clojure.core.async.impl.exec.threadpool
clojure.core.async.impl.ioc-macros
clojure.core.async.impl.mutex
clojure.core.async.impl.protocols
clojure.core.async.impl.timers
clojure.core.cache
clojure.core.memoize
clojure.core.protocols
clojure.core.server
clojure.data.json
clojure.data.priority-map
clojure.edn
clojure.instant
clojure.java.io
clojure.main
clojure.pprint
clojure.reflect
clojure.repl
clojure.set
CLJS
clojure.set
clojure.spec.alpha
clojure.spec.gen.alpha
clojure.string
CLJS
clojure.string
clojure.tools.analyzer
clojure.tools.analyzer.ast
clojure.tools.analyzer.env
clojure.tools.analyzer.jvm
clojure.tools.analyzer.jvm.utils
clojure.tools.analyzer.passes
clojure.tools.analyzer.passes.add-binding-atom
clojure.tools.analyzer.passes.cleanup
clojure.tools.analyzer.passes.constant-lifter
clojure.tools.analyzer.passes.elide-meta
clojure.tools.analyzer.passes.emit-form
clojure.tools.analyzer.passes.jvm.analyze-host-expr
clojure.tools.analyzer.passes.jvm.annotate-host-info
clojure.tools.analyzer.passes.jvm.annotate-loops
clojure.tools.analyzer.passes.jvm.annotate-tag
clojure.tools.analyzer.passes.jvm.box
clojure.tools.analyzer.passes.jvm.classify-invoke
clojure.tools.analyzer.passes.jvm.constant-lifter
clojure.tools.analyzer.passes.jvm.emit-form
clojure.tools.analyzer.passes.jvm.fix-case-test
clojure.tools.analyzer.passes.jvm.infer-tag
clojure.tools.analyzer.passes.jvm.validate
clojure.tools.analyzer.passes.jvm.validate-loop-locals
clojure.tools.analyzer.passes.jvm.validate-recur
clojure.tools.analyzer.passes.jvm.warn-on-reflection
clojure.tools.analyzer.passes.source-info
clojure.tools.analyzer.passes.trim
clojure.tools.analyzer.passes.uniquify
clojure.tools.analyzer.passes.warn-earmuff
clojure.tools.analyzer.utils
clojure.tools.cli
clojure.tools.namespace.dependency
clojure.tools.namespace.file
clojure.tools.namespace.find
clojure.tools.namespace.parse
clojure.tools.namespace.track
clojure.tools.reader
clojure.tools.reader.default-data-readers
clojure.tools.reader.impl.commons
clojure.tools.reader.impl.errors
clojure.tools.reader.impl.inspect
clojure.tools.reader.impl.utils
clojure.tools.reader.reader-types
clojure.walk
CLJS
clojure.walk
dynadoc.aliases
dynadoc.common
dynadoc.core
CLJS
dynadoc.core
dynadoc.example
CLJS
dynadoc.state
dynadoc.static
dynadoc.utils
dynadoc.watch
eval-soup.clojail
eval-soup.core
CLJS
eval-soup.core
CLJS
figwheel.client
CLJS
figwheel.client.file-reloading
CLJS
figwheel.client.heads-up
CLJS
figwheel.client.socket
CLJS
figwheel.client.utils
hawk.core
hawk.watcher
html-soup.core
ns-tracker.core
ns-tracker.dependency
ns-tracker.nsdeps
ns-tracker.parse
CLJS
oakcljs.tools.reader
CLJS
oakcljs.tools.reader.impl.commons
CLJS
oakcljs.tools.reader.impl.errors
CLJS
oakcljs.tools.reader.impl.inspect
CLJS
oakcljs.tools.reader.impl.utils
CLJS
oakcljs.tools.reader.reader-types
oakclojure.tools.reader
oakclojure.tools.reader.default-data-readers
oakclojure.tools.reader.impl.commons
oakclojure.tools.reader.impl.errors
oakclojure.tools.reader.impl.inspect
oakclojure.tools.reader.impl.utils
oakclojure.tools.reader.reader-types
org.httpkit.server
CLJS
paren-soup.console
CLJS
paren-soup.core
CLJS
paren-soup.dom
CLJS
paren-soup.instarepl
CLJS
reagent.core
CLJS
reagent.debug
CLJS
reagent.dom
CLJS
reagent.impl.batching
CLJS
reagent.impl.component
CLJS
reagent.impl.template
CLJS
reagent.impl.util
CLJS
reagent.ratom
ring.middleware.content-type
ring.middleware.file
ring.middleware.head
ring.middleware.keyword-params
ring.middleware.params
ring.middleware.reload
ring.middleware.resource
ring.util.codec
ring.util.io
ring.util.mime-type
ring.util.parsing
ring.util.request
ring.util.response
ring.util.time
rum.core
CLJS
rum.core
rum.cursor
rum.derived-atom
rum.server-render
rum.util
sablono.compiler
CLJS
sablono.core
sablono.normalize
sablono.util
tag-soup.core

(->PersistentPriorityMap priority->set-of-items item->priority _meta keyfn)

Positional factory function for class clojure.data.priority_map.PersistentPriorityMap.

Source

(deftype PersistentPriorityMap [priority->set-of-items item->priority _meta keyfn] Object (toString [this] (str (.seq this))) clojure.lang.ILookup ; valAt gives (get pm key) and (get pm key not-found) behavior (valAt [this item] (get item->priority item)) (valAt [this item not-found] (get item->priority item not-found)) clojure.lang.IPersistentMap (count [this] (count item->priority)) (assoc [this item priority] (let [current-priority (get item->priority item nil)] (if current-priority ;Case 1 - item is already in priority map, so this is a reassignment (if (= current-priority priority) ;Subcase 1 - no change in priority, do nothing this (let [priority-key (apply-keyfn priority) current-priority-key (apply-keyfn current-priority) item-set (get priority->set-of-items current-priority-key)] (if (= (count item-set) 1) ;Subcase 2 - it was the only item of this priority ;so remove old priority entirely ;and conj item onto new priority's set (PersistentPriorityMap. (assoc (dissoc priority->set-of-items current-priority-key) priority-key (conj (get priority->set-of-items priority-key #{}) item)) (assoc item->priority item priority) (meta this) keyfn) ;Subcase 3 - there were many items associated with the item's original priority, ;so remove it from the old set and conj it onto the new one. (PersistentPriorityMap. (assoc priority->set-of-items current-priority-key (disj (get priority->set-of-items current-priority-key) item) priority-key (conj (get priority->set-of-items priority-key #{}) item)) (assoc item->priority item priority) (meta this) keyfn)))) ; Case 2: Item is new to the priority map, so just add it. (let [priority-key (apply-keyfn priority)] (PersistentPriorityMap. (assoc priority->set-of-items priority-key (conj (get priority->set-of-items priority-key #{}) item)) (assoc item->priority item priority) (meta this) keyfn))))) (empty [this] (PersistentPriorityMap. (empty priority->set-of-items) {} _meta keyfn)) ; cons defines conj behavior (cons [this e] (if (map? e) (into this e) (let [[item priority] e] (.assoc this item priority)))) ; Like sorted maps, priority maps are equal to other maps provided ; their key-value pairs are the same. (equiv [this o] (= item->priority o)) (hashCode [this] (.hashCode item->priority)) (equals [this o] (or (identical? this o) (.equals item->priority o))) ;containsKey implements (contains? pm k) behavior (containsKey [this item] (contains? item->priority item)) (entryAt [this k] (let [v (.valAt this k this)] (when-not (identical? v this) (MapEntry. k v)))) (seq [this] (if keyfn (seq (for [[priority item-set] priority->set-of-items, item item-set] (MapEntry. item (item->priority item)))) (seq (for [[priority item-set] priority->set-of-items, item item-set] (MapEntry. item priority))))) ;without implements (dissoc pm k) behavior (without [this item] (let [priority (item->priority item ::not-found)] (if (= priority ::not-found) ;; If item is not in map, return the map unchanged. this (let [priority-key (apply-keyfn priority) item-set (priority->set-of-items priority-key)] (if (= (count item-set) 1) ;;If it is the only item with this priority, remove that priority's set completely (PersistentPriorityMap. (dissoc priority->set-of-items priority-key) (dissoc item->priority item) (meta this) keyfn) ;;Otherwise, just remove the item from the priority's set. (PersistentPriorityMap. (assoc priority->set-of-items priority-key (disj item-set item)), (dissoc item->priority item) (meta this) keyfn)))))) java.io.Serializable ;Serialization comes for free with the other things implemented clojure.lang.MapEquivalence Map ;Makes this compatible with java's map (size [this] (count item->priority)) (isEmpty [this] (zero? (count item->priority))) (containsValue [this v] (if keyfn (some (partial = v) (vals this)) ; no shortcut if there is a keyfn (contains? priority->set-of-items v))) (get [this k] (.valAt this k)) (put [this k v] (throw (UnsupportedOperationException.))) (remove [this k] (throw (UnsupportedOperationException.))) (putAll [this m] (throw (UnsupportedOperationException.))) (clear [this] (throw (UnsupportedOperationException.))) (keySet [this] (set (keys this))) (values [this] (vals this)) (entrySet [this] (set this)) Iterable (iterator [this] (clojure.lang.SeqIterator. (seq this))) clojure.lang.IPersistentStack (peek [this] (when-not (.isEmpty this) (let [f (first priority->set-of-items) item (first (val f))] (if keyfn (MapEntry. item (item->priority item)) (MapEntry. item (key f)))))) (pop [this] (if (.isEmpty this) (throw (IllegalStateException. "Can't pop empty priority map")) (let [f (first priority->set-of-items), item-set (val f) item (first item-set), priority-key (key f)] (if (= (count item-set) 1) ;If the first item is the only item with its priority, remove that priority's set completely (PersistentPriorityMap. (dissoc priority->set-of-items priority-key) (dissoc item->priority item) (meta this) keyfn) ;Otherwise, just remove the item from the priority's set. (PersistentPriorityMap. (assoc priority->set-of-items priority-key (disj item-set item)), (dissoc item->priority item) (meta this) keyfn))))) clojure.lang.IFn ;makes priority map usable as a function (invoke [this k] (.valAt this k)) (invoke [this k not-found] (.valAt this k not-found)) clojure.lang.IObj ;adds metadata support (meta [this] _meta) (withMeta [this m] (PersistentPriorityMap. priority->set-of-items item->priority m keyfn)) clojure.lang.Reversible (rseq [this] (if keyfn (seq (for [[priority item-set] (rseq priority->set-of-items), item item-set] (MapEntry. item (item->priority item)))) (seq (for [[priority item-set] (rseq priority->set-of-items), item item-set] (MapEntry. item priority))))))