Package org.jline.reader.impl
Class BufferImpl
- java.lang.Object
-
- org.jline.reader.impl.BufferImpl
-
- All Implemented Interfaces:
Buffer
public class BufferImpl extends java.lang.Object implements Buffer
A holder for aStringBuilder
that 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 int
atChar(int i)
boolean
backspace()
Issue a backspace.int
backspace(int num)
Issue num backspaces.boolean
clear()
BufferImpl
copy()
void
copyFrom(Buffer buf)
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()
java.lang.String
substring(int start)
java.lang.String
substring(int start, int end)
java.lang.String
toString()
boolean
up()
java.lang.String
upToCursor()
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(java.lang.CharSequence str)
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.void
write(java.lang.CharSequence str, boolean overTyping)
void
zeroOut()
Clear any internal buffer.
-
-
-
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(java.lang.CharSequence str)
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.
-
write
public void write(java.lang.CharSequence str, boolean overTyping)
-
substring
public java.lang.String substring(int start, int end)
-
upToCursor
public java.lang.String 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.
-
backspace
public int backspace(int num)
Issue num backspaces.
-
backspace
public boolean backspace()
Issue a backspace.
-
toString
public java.lang.String toString()
-
-