when<S> abstract method

S when<S>({
  1. required S insert(
    1. INode data,
    2. int position
    ),
  2. required S remove(
    1. INode data,
    2. int? position
    ),
  3. required S add(
    1. INode data
    ),
  4. required S update(
    1. INode update
    ),
})

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 NodeInsert @param remove callback function to be called if this object is of type NodeRemove @param add callback function to be called if this object is of type NodeAdd

Implementation

S when<S>({
  required S Function(INode data, int position) insert,
  required S Function(INode data, int? position) remove,
  required S Function(INode data) add,
  required S Function(INode update) update,
});