Package org.jline.reader.impl
Class UndoTree<T>
- java.lang.Object
-
- org.jline.reader.impl.UndoTree<T>
-
- Type Parameters:
T
- the type of state object being tracked
public class UndoTree<T> extends java.lang.Object
Provides undo/redo functionality for the LineReader.This class implements a simple undo tree that allows tracking and restoring previous states of an object (typically the line buffer). It maintains a linear history of states that can be navigated with undo and redo operations.
Key features:
- Tracks a sequence of states that can be undone and redone
- Uses a consumer to apply state changes when undoing or redoing
- Maintains the current position in the undo history
Note that the first added state (the initial state) cannot be undone.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRedo()
boolean
canUndo()
void
clear()
void
newState(T state)
void
redo()
void
undo()
-