jline

Class CursorBuffer

public class CursorBuffer extends Object

A CursorBuffer is a holder for a StringBuffer that also contains the current cursor position.

Author: Marc Prud'hommeaux

Field Summary
intcursor
Method Summary
booleanclearBuffer()
charcurrent()
StringBuffergetBuffer()
booleanisOvertyping()
intlength()
voidsetBuffer(StringBuffer buffer)
voidsetOvertyping(boolean b)
StringtoString()
voidwrite(char c)
Write the specific character into the buffer, setting the cursor position ahead one.
voidwrite(String str)
Insert the specified String into the buffer, setting the cursor to the end of the insertion point.

Field Detail

cursor

public int cursor

Method Detail

clearBuffer

public boolean clearBuffer()

current

public char current()

getBuffer

public StringBuffer getBuffer()

isOvertyping

public boolean isOvertyping()

length

public int length()

setBuffer

public void setBuffer(StringBuffer buffer)

setOvertyping

public void setOvertyping(boolean b)

toString

public String toString()

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(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.

Copyright © 2002-2010. All Rights Reserved.