Package jline.console
Class CursorBuffer
- java.lang.Object
-
- jline.console.CursorBuffer
-
public class CursorBuffer extends java.lang.Object
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 CursorBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
clear()
CursorBuffer
copy()
char
current()
boolean
isOverTyping()
int
length()
char
nextChar()
void
setOverTyping(boolean b)
java.lang.String
toString()
java.lang.String
upToCursor()
void
write(char c)
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.
-
-
-
Method Detail
-
copy
public CursorBuffer copy()
-
isOverTyping
public boolean isOverTyping()
-
setOverTyping
public void setOverTyping(boolean b)
-
length
public int length()
-
nextChar
public char nextChar()
-
current
public char current()
-
write
public void write(char c)
Write the specific character into the buffer, setting the cursor position ahead one. The text may overwrite or insert based on the current setting ofisOverTyping()
.- Parameters:
c
- the character to insert
-
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.
-
clear
public boolean clear()
-
upToCursor
public java.lang.String upToCursor()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-