Class BufferImpl

java.lang.Object
org.jline.reader.impl.BufferImpl
All Implemented Interfaces:
Buffer

public class BufferImpl extends Object implements Buffer
Default implementation of the Buffer interface.

This class provides a mutable buffer for storing and manipulating the text being edited in the LineReader. It maintains the text content and the current cursor position, and provides methods for text insertion, deletion, and cursor movement.

Key features include:

  • Efficient text insertion and deletion with a gap buffer implementation
  • Support for Unicode characters beyond the Basic Multilingual Plane
  • Cursor movement in both character and line coordinates
  • Copy and paste operations
  • Secure clearing of buffer contents

The buffer uses a gap buffer data structure for efficient editing operations, which provides good performance for the typical editing patterns in a line editor.

Since:
2.0
See Also: