Package org.jline.reader.impl
Class BufferImpl
java.lang.Object
org.jline.reader.impl.BufferImpl
- All Implemented Interfaces:
Buffer
A holder for a
StringBuilder
that also contains the current cursor position.- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
adjust
(int i) int
atChar
(int i) boolean
Issue a backspace.int
backspace
(int num) Issue num backspaces.boolean
clear()
copy()
void
int
currChar()
boolean
currChar
(int ch) int
cursor()
boolean
cursor
(int position) Move the cursor position to the specified absolute index.boolean
delete()
int
delete
(int num) boolean
down()
private int
int
length()
int
move
(int num) Move the cursor where characters.private void
boolean
moveXY
(int dx, int dy) int
nextChar()
int
prevChar()
substring
(int start) substring
(int start, int end) toString()
boolean
up()
void
write
(int c) Write the specific character into the buffer, setting the cursor position ahead one.private void
write
(int[] ucps) void
write
(int c, boolean overTyping) Write the specific character into the buffer, setting the cursor position ahead one.void
write
(CharSequence str) Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.void
write
(CharSequence str, boolean overTyping)
-
Field Details
-
cursor
private int cursor -
cursorCol
private int cursorCol -
buffer
private int[] buffer -
g0
private int g0 -
g1
private int g1
-
-
Constructor Details
-
BufferImpl
public BufferImpl() -
BufferImpl
public BufferImpl(int size) -
BufferImpl
-
-
Method Details
-
copy
-
cursor
public int cursor() -
length
public int length() -
currChar
public boolean currChar(int ch) -
currChar
public int currChar() -
prevChar
public int prevChar() -
nextChar
public int nextChar() -
atChar
public int atChar(int i) -
adjust
private int adjust(int i) -
write
public void write(int c) Write the specific character into the buffer, setting the cursor position ahead one. -
write
public void write(int c, boolean overTyping) Write the specific character into the buffer, setting the cursor position ahead one. The text may overwrite or insert based on the current setting ofoverTyping
. -
write
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point. -
write
-
write
private void write(int[] ucps) -
clear
public boolean clear() -
substring
-
substring
-
upToCursor
- Specified by:
upToCursor
in interfaceBuffer
-
cursor
public boolean cursor(int position) Move the cursor position to the specified absolute index. -
move
public int move(int num) Move the cursor where characters. -
up
public boolean up() -
down
public boolean down() -
moveXY
public boolean moveXY(int dx, int dy) -
getCursorCol
private int getCursorCol() -
backspace
public int backspace(int num) Issue num backspaces. -
backspace
public boolean backspace()Issue a backspace. -
delete
public int delete(int num) -
delete
public boolean delete() -
toString
-
copyFrom
-
moveGapToCursor
private void moveGapToCursor()
-