@@ -5,19 +5,19 @@ package net.pelsmaeker.collections
55/* *
66 * Returns an empty persistent disjoint map.
77 *
8- * @param K the type of keys
9- * @param V the type of values
10- * @return an empty persistent disjoint map
8+ * @param K The type of keys.
9+ * @param V The type of values.
10+ * @return An empty persistent disjoint map.
1111 */
1212fun <K , V > persistentDisjointMapOf (): PersistentDisjointMap <K , V > = PersistentUnionFindMap .emptyOf()
1313
1414/* *
1515 * Returns a persistent disjoint map with the given sets.
1616 *
17- * @param pairs the pairs of sets, consisting of a set of keys and an associated value
18- * @param K the type of keys
19- * @param V the type of values
20- * @return the created persistent disjoint map
17+ * @param pairs The pairs of sets, consisting of a set of keys and an associated value.
18+ * @param K The type of keys.
19+ * @param V The type of values.
20+ * @return The created persistent disjoint map.
2121 */
2222fun <K , V > persistentDisjointMapOf (vararg pairs : Pair <Set <K >, V >): PersistentDisjointMap <K , V > {
2323 return pairs.asIterable().toPersistentDisjointMap()
@@ -26,19 +26,19 @@ fun <K, V> persistentDisjointMapOf(vararg pairs: Pair<Set<K>, V>): PersistentDis
2626/* *
2727 * Returns an empty mutable disjoint map.
2828 *
29- * @param K the type of keys
30- * @param V the type of values
31- * @return an empty mutable disjoint map
29+ * @param K The type of keys.
30+ * @param V The type of values.
31+ * @return An empty mutable disjoint map.
3232 */
3333fun <K , V > mutableDisjointMapOf (): MutableDisjointMap <K , V > = MutableUnionFindMap ()
3434
3535/* *
3636 * Returns a mutable disjoint map with the given sets.
3737 *
38- * @param pairs the pairs of sets, consisting of a set of keys and an associated value
39- * @param K the type of keys
40- * @param V the type of values
41- * @return the created mutable disjoint map
38+ * @param pairs The pairs of sets, consisting of a set of keys and an associated value.
39+ * @param K The type of keys.
40+ * @param V The type of values.
41+ * @return The created mutable disjoint map.
4242 */
4343fun <K , V > mutableDisjointMapOf (vararg pairs : Pair <Set <K >, V >): MutableDisjointMap <K , V > {
4444 return pairs.asIterable().toMutableDisjointMap()
@@ -49,9 +49,9 @@ fun <K, V> mutableDisjointMapOf(vararg pairs: Pair<Set<K>, V>): MutableDisjointM
4949 *
5050 * If the receiver is already an immutable disjoint map, it is returned as-is.
5151 *
52- * @param K the type of keys
53- * @param V the type of values
54- * @return the resulting immutable disjoint map
52+ * @param K The type of keys.
53+ * @param V The type of values.
54+ * @return The resulting immutable disjoint map.
5555 */
5656fun <K , V > DisjointMap <K , V >.toImmutableDisjointMap (): ImmutableDisjointMap <K , V > {
5757 return this as ? ImmutableDisjointMap <K , V > ? : this .toPersistentDisjointMap()
@@ -63,9 +63,9 @@ fun <K, V> DisjointMap<K, V>.toImmutableDisjointMap(): ImmutableDisjointMap<K, V
6363 * If the receiver is already a persistent disjoint map, it is returned as-is.
6464 * If the receiver is a persistent disjoint map builder, the result of calling its [PersistentDisjointMap.Builder.build] method is returned.
6565 *
66- * @param K the type of keys
67- * @param V the type of values
68- * @return the resulting persistent disjoint map
66+ * @param K The type of keys.
67+ * @param V The type of values.
68+ * @return The resulting persistent disjoint map.
6969 */
7070fun <K , V > DisjointMap <K , V >.toPersistentDisjointMap (): PersistentDisjointMap <K , V > {
7171 return this as ? PersistentDisjointMap <K , V >
@@ -76,9 +76,9 @@ fun <K, V> DisjointMap<K, V>.toPersistentDisjointMap(): PersistentDisjointMap<K,
7676/* *
7777 * Returns the given map of sets as a persistent disjoint map.
7878 *
79- * @param K the type of keys
80- * @param V the type of values
81- * @return the resulting persistent disjoint map
79+ * @param K The type of keys.
80+ * @param V The type of values.
81+ * @return The resulting persistent disjoint map.
8282 */
8383fun <K , V > Map <Set <K >, V>.toPersistentDisjointMap (): PersistentDisjointMap <K , V > {
8484 return this .entries.map { it.toPair() }.toPersistentDisjointMap()
@@ -87,9 +87,9 @@ fun <K, V> Map<Set<K>, V>.toPersistentDisjointMap(): PersistentDisjointMap<K, V>
8787/* *
8888 * Returns the given map of sets as a mutable disjoint map.
8989 *
90- * @param K the type of keys
91- * @param V the type of values
92- * @return the resulting mutable disjoint map
90+ * @param K The type of keys.
91+ * @param V The type of values.
92+ * @return The resulting mutable disjoint map.
9393 */
9494private fun <K , V > Map <Set <K >, V>.toMutableDisjointMap (): MutableDisjointMap <K , V > {
9595 return this .entries.map { it.toPair() }.toMutableDisjointMap()
@@ -98,9 +98,9 @@ private fun <K, V> Map<Set<K>, V>.toMutableDisjointMap(): MutableDisjointMap<K,
9898/* *
9999 * Returns the given iterable of pairs of a set of keys and a value as a persistent disjoint map.
100100 *
101- * @param K the type of keys
102- * @param V the type of values
103- * @return the resulting persistent disjoint map
101+ * @param K The type of keys.
102+ * @param V The type of values.
103+ * @return The resulting persistent disjoint map.
104104 */
105105fun <K , V > Iterable <Pair <Set <K >, V>>.toPersistentDisjointMap (): PersistentDisjointMap <K , V > {
106106 return PersistentUnionFindMap .emptyOf<K , V >().builder().addSets(this ).build()
@@ -109,9 +109,9 @@ fun <K, V> Iterable<Pair<Set<K>, V>>.toPersistentDisjointMap(): PersistentDisjoi
109109/* *
110110 * Returns the given iterable of pairs of a set of keys and a value as a mutable disjoint map.
111111 *
112- * @param K the type of keys
113- * @param V the type of values
114- * @return the resulting mutable disjoint map
112+ * @param K The type of keys.
113+ * @param V The type of values.
114+ * @return The resulting mutable disjoint map.
115115 */
116116private fun <K , V > Iterable <Pair <Set <K >, V>>.toMutableDisjointMap (): MutableDisjointMap <K , V > {
117117 return mutableDisjointMapOf<K , V >().addSets(this )
@@ -120,10 +120,10 @@ private fun <K, V> Iterable<Pair<Set<K>, V>>.toMutableDisjointMap(): MutableDisj
120120/* *
121121 * Adds the given sets to the mutable disjoint map.
122122 *
123- * @param sets the sets to add, an iterable of pairs of a set of keys and a value
124- * @param K the type of keys
125- * @param V the type of values
126- * @return the receiver
123+ * @param sets The sets to add, an iterable of pairs of a set of keys and a value.
124+ * @param K The type of keys.
125+ * @param V The type of values.
126+ * @return The receiver.
127127 */
128128private fun <K , V , T : MutableDisjointMap <K , V >> T.addSets (sets : Iterable <Pair <Set <K >, V >>): T {
129129 for ((keys, value) in sets) {
@@ -140,10 +140,10 @@ private fun <K, V, T: MutableDisjointMap<K, V>> T.addSets(sets: Iterable<Pair<Se
140140 *
141141 * The mutable disjoint map passed to [mutator] had the same contents as the persistent disjoint map.
142142 *
143- * @param mutator the closure that mutates the map
144- * @param K the type of keys
145- * @param V the type of values
146- * @return a persistent disjoint map with the modifications applied
143+ * @param mutator The closure that mutates the map.
144+ * @param K The type of keys.
145+ * @param V The type of values.
146+ * @return A persistent disjoint map with the modifications applied.
147147 */
148148inline fun <K , V > PersistentDisjointMap <K , V >.mutate (mutator : (MutableDisjointMap <K , V >) -> Unit ): PersistentDisjointMap <K , V >
149149 = this .builder().apply (mutator).build()
0 commit comments