Interface FlowMapping<T,C extends Cell<T>>

All Known Implementing Classes:
FlowMapping.AbstractMapping, FlowMapping.FullMapping, FlowMapping.PartialMapping, FlowMapping.ValidMapping

public interface FlowMapping<T,C extends Cell<T>>
Utility API used by the FlowState to map indexes from an old state to a new one.

There are three concrete implementations which extend the common abstract class AbstractMapping:

FlowMapping.ValidMapping: a valid mapping means that a cell can be removed from the old state and copied as is to the new one

FlowMapping.PartialMapping: a partial mapping means that a cell should be removed from the old state and copied to the new state after updating its index

FlowMapping.FullMapping: a full mapping means that a cell should be removed from the old state and copied to the new state only after both its index and item have been updated. Often a FullMapping can also receive a negative index as the "oldIndex" parameter of manage(FlowState, FlowState), this means that no cells are left in the old state and a new one must be created to reach FlowState.getTargetSize()

  • Method Details

    • manage

      void manage(FlowState<T,C> oldState, FlowState<T,C> newState)
    • getOldIndex

      int getOldIndex()
    • getNewIndex

      int getNewIndex()