Package jline
Class CursorBuffer
- java.lang.Object
-
- jline.CursorBuffer
-
public class CursorBuffer extends java.lang.ObjectA CursorBuffer is a holder for aStringBufferthat also contains the current cursor position.- Author:
- Marc Prud'hommeaux
-
-
Field Summary
Fields Modifier and Type Field Description intcursor
-
Constructor Summary
Constructors Constructor Description CursorBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclearBuffer()charcurrent()java.lang.StringBuffergetBuffer()booleanisOvertyping()intlength()voidsetBuffer(java.lang.StringBuffer buffer)voidsetOvertyping(boolean b)java.lang.StringtoString()voidwrite(char c)Write the specific character into the buffer, setting the cursor position ahead one.voidwrite(java.lang.String str)Insert the specifiedStringinto the buffer, setting the cursor to the end of the insertion point.
-
-
-
Method Detail
-
length
public int length()
-
current
public char current()
-
clearBuffer
public boolean clearBuffer()
-
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.String str)
Insert the specifiedStringinto the buffer, setting the cursor to the end of the insertion point.- Parameters:
str- the String to insert. Must not be null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isOvertyping
public boolean isOvertyping()
-
setOvertyping
public void setOvertyping(boolean b)
-
getBuffer
public java.lang.StringBuffer getBuffer()
-
setBuffer
public void setBuffer(java.lang.StringBuffer buffer)
-
-