A Patch encapsulates all information required to transform the base
sequence into the target
sequence.
A Patch encapsulates all information required to transform the base
sequence into the target
sequence.
In addition to the data of which elements need to be deleted and/or moved it also contains the actual elements that are to be inserted.
- Companion
- object
Value members
Concrete methods
Applies this patch to the given base
sequence, producing either the original target
sequence or an error.
Applies this patch to the given base
sequence, producing either the original target
sequence or an error.
Returns an equivalent patch that has all its steps sorted by baseIx
.
Returns an equivalent patch that has all its steps sorted by baseIx
.
NOTE: The steps will be sorted anyway during application of the patch against a base
sequence,
so the steps can be held in any order in the Patch sequence.
Pre-sorting of the steps as it is done here is therefore not required, but may be beneficial for presentation or
other "normalization" processes.
Applies this patch to the given base
sequence, producing the original target
sequence or
throwing a Patch.Failure.
Applies this patch to the given base
sequence, producing the original target
sequence or
throwing a Patch.Failure.
Applies this patch to the given base
sequence, producing a Try instance holding either the original
target
sequence or a Patch.Failure.
Applies this patch to the given base
sequence, producing a Try instance holding either the original
target
sequence or a Patch.Failure.