when<S> method

  1. @override
S when<S>({
  1. required S insert(
    1. int p1,
    2. T p2
    ),
  2. required S remove(
    1. int p1,
    2. T p2
    ),
  3. required S change(
    1. int p1,
    2. T p2,
    3. T p3
    ),
  4. required S move(
    1. int p1,
    2. int p2,
    3. T data
    ),
})
override

call one of the given callback functions depending on the type of this object.

@param insert callback function to be called if this object is of type DataInsert @param remove callback function to be called if this object is of type DateRemove @param change callback function to be called if this object is of type DateChange @param move callback function to be called if this object is of type DateMove

Implementation

@override
S when<S>(
    {required S Function(int p1, T p2) insert,
    required S Function(int p1, T p2) remove,
    required S Function(int p1, T p2, T p3) change,
    required S Function(int p1, int p2, T data) move}) {
  return change(position, oldData, newData);
}