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
- Author:
- Marc Prud'hommeaux, Jason Dillon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
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()
int
length()
int
move
(int num) Move the cursor where characters.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.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)
-
Constructor Details
-
BufferImpl
public BufferImpl() -
BufferImpl
public BufferImpl(int size)
-
-
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) -
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
-
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) -
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
-