method calculateChangeRecords


List<ListChangeRecord> calculateChangeRecords(List<Object> oldValue, List<Object> newValue)

Calculates the changes to the list, if lacking individual splice mutation information.

This is not needed for change records produced by ObservableList itself, but it can be used if the list instance was replaced by another list.

The minimal set of splices can be synthesized given the previous state and final state of a list. The basic approach is to calculate the edit distance matrix and choose the shortest path through it.

Complexity is O(l * p) where l is the length of the current list and p is the length of the old list.

Source

static List<ListChangeRecord> calculateChangeRecords(
    List<Object> oldValue, List<Object> newValue) =>
    calcSplices(newValue, 0, newValue.length, oldValue, 0, oldValue.length);