Package jline.console

Class CursorBuffer

java.lang.Object
jline.console.CursorBuffer

public class CursorBuffer extends Object
A holder for a StringBuilder that also contains the current cursor position.
Since:
2.0
Author:
Marc Prud'hommeaux, Jason Dillon
  • Field Details

    • cursor

      public int cursor
    • buffer

      public final StringBuilder buffer
  • Constructor Details

    • CursorBuffer

      public CursorBuffer()
  • Method Details

    • copy

      public CursorBuffer copy()
    • isOverTyping

      public boolean isOverTyping()
    • setOverTyping

      public void setOverTyping(boolean b)
    • length

      public int length()
    • nextChar

      public char nextChar()
    • 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(CharSequence str)
      Insert the specified chars into the buffer, setting the cursor to the end of the insertion point.
    • clear

      public boolean clear()
    • upToCursor

      public String upToCursor()
    • toString

      public String toString()
      Overrides:
      toString in class Object