public class

CursorBuffer

extends Object
java.lang.Object
   ↳ jline.console.CursorBuffer

Class Overview

A holder for a StringBuilder that also contains the current cursor position.

Summary

Fields
public final StringBuilder buffer
public int cursor
Public Constructors
CursorBuffer()
Public Methods
boolean clear()
CursorBuffer copy()
char current()
boolean isOverTyping()
int length()
char nextChar()
void setOverTyping(boolean b)
String toString()
String upToCursor()
void write(char c)
Write the specific character into the buffer, setting the cursor position ahead one.
void write(CharSequence str)
Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public final StringBuilder buffer

public int cursor

Public Constructors

public CursorBuffer ()

Public Methods

public boolean clear ()

public CursorBuffer copy ()

public char current ()

public boolean isOverTyping ()

public int length ()

public char nextChar ()

public void setOverTyping (boolean b)

public String toString ()

public String upToCursor ()

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

public void write (CharSequence str)

Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.