jline

Class CursorBuffer


public class CursorBuffer
extends java.lang.Object

A CursorBuffer is a holder for a StringBuffer that also contains the current cursor position.
Author:
Marc Prud'hommeaux

Field Summary

int
cursor

Method Summary

boolean
clearBuffer()
char
current()
JLineBuffer
getBuffer()
boolean
isOvertyping()
int
length()
void
setBuffer(JLineBuffer buffer)
void
setOvertyping(boolean b)
String
toString()
void
write(String str)
Insert the specified String into the buffer, setting the cursor to the end of the insertion point.
void
write(char c)
Write the specific character into the buffer, setting the cursor position ahead one.

Field Details

cursor

public int cursor

Method Details

clearBuffer

public boolean clearBuffer()

current

public char current()

getBuffer

public JLineBuffer getBuffer()

isOvertyping

public boolean isOvertyping()

length

public int length()

setBuffer

public void setBuffer(JLineBuffer buffer)

setOvertyping

public void setOvertyping(boolean b)

toString

public String toString()

write

public void write(String str)
Insert the specified String into the buffer, setting the cursor to the end of the insertion point.
Parameters:
str - the String to insert. Must not be null.

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