Module org.jline

Class BufferImpl

    • Constructor Detail

      • BufferImpl

        public BufferImpl()
      • BufferImpl

        public BufferImpl​(int size)
    • Method Detail

      • cursor

        public int cursor()
        Specified by:
        cursor in interface Buffer
      • length

        public int length()
        Specified by:
        length in interface Buffer
      • currChar

        public boolean currChar​(int ch)
        Specified by:
        currChar in interface Buffer
      • currChar

        public int currChar()
        Specified by:
        currChar in interface Buffer
      • prevChar

        public int prevChar()
        Specified by:
        prevChar in interface Buffer
      • nextChar

        public int nextChar()
        Specified by:
        nextChar in interface Buffer
      • atChar

        public int atChar​(int i)
        Specified by:
        atChar in interface Buffer
      • write

        public void write​(int c)
        Write the specific character into the buffer, setting the cursor position ahead one.
        Specified by:
        write in interface Buffer
        Parameters:
        c - the character to insert
      • write

        public void write​(int c,
                          boolean overTyping)
        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 overTyping.
        Specified by:
        write in interface Buffer
        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.
        Specified by:
        write in interface Buffer
      • clear

        public boolean clear()
        Specified by:
        clear in interface Buffer
      • substring

        public String substring​(int start,
                                int end)
        Specified by:
        substring in interface Buffer
      • cursor

        public boolean cursor​(int position)
        Move the cursor position to the specified absolute index.
        Specified by:
        cursor in interface Buffer
      • move

        public int move​(int num)
        Move the cursor where characters.
        Specified by:
        move in interface Buffer
        Parameters:
        num - If less than 0, move abs(where) to the left, otherwise move where to the right.
        Returns:
        The number of spaces we moved
      • up

        public boolean up()
        Specified by:
        up in interface Buffer
      • down

        public boolean down()
        Specified by:
        down in interface Buffer
      • moveXY

        public boolean moveXY​(int dx,
                              int dy)
        Specified by:
        moveXY in interface Buffer
      • backspace

        public int backspace​(int num)
        Issue num backspaces.
        Specified by:
        backspace in interface Buffer
        Returns:
        the number of characters backed up
      • backspace

        public boolean backspace()
        Issue a backspace.
        Specified by:
        backspace in interface Buffer
        Returns:
        true if successful
      • delete

        public int delete​(int num)
        Specified by:
        delete in interface Buffer
      • delete

        public boolean delete()
        Specified by:
        delete in interface Buffer