From 00943c9cdf17724425bde5d020f61aebe915da7f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 23 Sep 2022 12:10:24 +0600 Subject: [PATCH] add docs for Diff class --- .../kotlin/dev/inmo/micro_utils/common/DiffUtils.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt index c1da3f3aa72..f885b9f2ba1 100644 --- a/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt +++ b/common/src/commonMain/kotlin/dev/inmo/micro_utils/common/DiffUtils.kt @@ -14,6 +14,14 @@ private inline fun getObject( /** * Diff object which contains information about differences between two [Iterable]s * + * See tests for more info + * + * @param removed The objects which has been presented in the old collection but absent in new one. Index here is the index in the old collection + * @param added The object which appear in new collection only. Indexes here show the index in the new collection + * @param replaced Pair of old-new changes. First object has been presented in the old collection on its + * [IndexedValue.index] place, the second one is the object in new collection. Both have indexes due to the fact that in + * case when some value has been replaced after adds or removes in original collection the object index will be changed + * * @see calculateDiff */ data class Diff internal constructor(