Java: versioned data structures?

前端 未结 6 2617
别那么骄傲
别那么骄傲 2021-02-20 13:24

I have a data structure that is pretty simple (basically a structure containing some arrays and single values), but I need to record the history of the data structure so that I

6条回答
  •  春和景丽
    2021-02-20 13:41

    Multi-level undo can be based on a model (ie data structure) and a sequence of actions. Each action supports two operations: "do" and "undo". To perform a change on the model you register a new action and "do" it. This allows you to "walk" back and forth in the history, but the state of the model at a specific index cannot be accessed in constant time.

    Maybe something like this would be applicable to your situation?

提交回复
热议问题