jline.console
Class CursorBuffer
java.lang.Object
jline.console.CursorBuffer
public class CursorBuffer
- extends java.lang.Object
A holder for a StringBuilder
that also contains the current cursor position.
- Since:
- 2.0
- Author:
- Marc Prud'hommeaux, Jason Dillon
Method Summary |
boolean |
clear()
|
char |
current()
|
boolean |
isOverTyping()
|
int |
length()
|
void |
setOverTyping(boolean b)
|
java.lang.String |
toString()
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
cursor
public int cursor
buffer
public final java.lang.StringBuilder buffer
CursorBuffer
public CursorBuffer()
isOverTyping
public boolean isOverTyping()
setOverTyping
public void setOverTyping(boolean b)
length
public int length()
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
of
isOverTyping()
.
- 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()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object