- java.lang.Object
-
- org.jline.reader.impl.BufferImpl
-
- All Implemented Interfaces:
Buffer
public class BufferImpl extends Object implements Buffer
A holder for aStringBuilderthat also contains the current cursor position.- Since:
- 2.0
- Author:
- Marc Prud'hommeaux, Jason Dillon
-
-
Constructor Summary
Constructors Constructor Description BufferImpl()BufferImpl(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intatChar(int i)booleanbackspace()Issue a backspace.intbackspace(int num)Issue num backspaces.booleanclear()BufferImplcopy()voidcopyFrom(Buffer buf)intcurrChar()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()Stringsubstring(int start)Stringsubstring(int start, int end)StringtoString()booleanup()StringupToCursor()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)
-
-
-
Method Detail
-
copy
public BufferImpl copy()
-
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
public void write(CharSequence str)
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.
-
write
public void write(CharSequence str, boolean overTyping)
-
upToCursor
public String 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.
-
backspace
public int backspace(int num)
Issue num backspaces.
-
backspace
public boolean backspace()
Issue a backspace.
-
toString
public String toString()
-
-