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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintatChar(int i) booleanIssue a backspace.intbackspace(int num) Issue num backspaces.booleanclear()copy()voidintcurrChar()booleancurrChar(int ch) intcursor()booleancursor(int position) Move the cursor position to the specified absolute index.booleandelete()intdelete(int num) booleandown()intlength()intmove(int num) Move the cursor where characters.booleanmoveXY(int dx, int dy) intnextChar()intprevChar()substring(int start) substring(int start, int end) toString()booleanup()voidwrite(int c) Write the specific character into the buffer, setting the cursor position ahead one.voidwrite(int c, boolean overTyping) Write the specific character into the buffer, setting the cursor position ahead one.voidwrite(CharSequence str) Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.voidwrite(CharSequence str, boolean overTyping) voidzeroOut()Clear any internal buffer.
-
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:
upToCursorin 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
-
zeroOut
public void zeroOut()Description copied from interface:BufferClear any internal buffer.
-