Class ScrollbackBuffer
java.lang.Object
org.aesh.terminal.tty.split.ScrollbackBuffer
A circular buffer that stores lines for a screen region's scrollback history.
When the buffer reaches its maximum capacity, the oldest lines are dropped. Thread-safe for concurrent reads and writes.
-
Constructor Summary
ConstructorsConstructorDescriptionScrollbackBuffer(int maxLines) Creates a scrollback buffer with the specified capacity. -
Method Summary
-
Constructor Details
-
ScrollbackBuffer
public ScrollbackBuffer(int maxLines) Creates a scrollback buffer with the specified capacity.- Parameters:
maxLines- maximum number of lines to store
-
-
Method Details
-
addLine
Add a line to the buffer. If the buffer is full, the oldest line is dropped.- Parameters:
line- the line to add
-
getLastLines
-
size
public int size()Returns the number of lines currently stored.- Returns:
- the line count
-
clear
public void clear()Clear all stored lines.
-