You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This encoder will replicate the behavior of a standard encoding, but calling the `encode*Element` methods in
16
16
* the order defined by [mapElementIndex]. It first buffers each `encode*Element` calls in an array following
17
17
* the given indexes using [mapElementIndex], then when [endStructure] is called, it encodes the buffered calls
18
-
* in the expected order by replaying the previous calls on a concrete [CompositeEncoder] provided
19
-
* by [beginStructure].
18
+
* in the expected order by replaying the previous calls on the given [compositeEncoderDelegate].
20
19
*
21
-
* @param structureDescriptor descriptor of the structure being encoded
22
-
* @param beginStructure provides the [CompositeEncoder] to be used to encode the given descriptor's elements in the expected order.
23
-
* @param mapElementIndex maps the element index to the new reordered index (zero-based). If this mapper provides the same index for multiple elements, only the last one will be encoded as the previous ones will be overridden.
20
+
* @param compositeEncoderDelegate the [CompositeEncoder] to be used to encode the given descriptor's elements in the expected order.
21
+
* @param structureDescriptor descriptor of the structure being encoded and reordered
22
+
* @param mapElementIndex maps the element index to a new positional zero-based index. If this mapper provides the same index for multiple elements, only the last one will be encoded as the previous ones will be overridden. The mapped index just helps to reorder the elements, but the reordered `encode*Element` method calls will still pass the original element index.
@@ -231,10 +237,10 @@ internal class ReorderingCompositeEncoder(
231
237
* Encodes the [structureDescriptor] elements in a specific order provided by [elementIndexMapper].
232
238
*
233
239
* @param structureDescriptor descriptor of the structure being encoded and reordered
234
-
* @param elementIndexMapper maps the element index to the new reordered index (zero-based). If this mapper provides the same index for multiple elements, only the last one will be encoded as the previous ones will be overridden.
240
+
* @param elementIndexMapper maps the element index to a new positional zero-based index. If this mapper provides the same index for multiple elements, only the last one will be encoded as the previous ones will be overridden. The mapped index just helps to reorder the elements, but the reordered `encode*Element` method calls will still pass the original element index.
0 commit comments