Class PasteManager

java.lang.Object
org.aesh.readline.paste.PasteManager

public class PasteManager extends Object
Keep track of edits for paste
Author:
Ståle W. Pedersen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new PasteManager with an empty paste stack.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addText(int[] buffer)
    Adds text to the paste stack.
    int[]
    get(int index)
    Retrieves text from the paste stack at the specified index.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PasteManager

      public PasteManager()
      Creates a new PasteManager with an empty paste stack.
  • Method Details

    • addText

      public void addText(int[] buffer)
      Adds text to the paste stack. If the stack exceeds its maximum size, the oldest entry is removed.
      Parameters:
      buffer - the text buffer (as code points) to add to the paste stack
    • get

      public int[] get(int index)
      Retrieves text from the paste stack at the specified index. Index 0 returns the most recently added text.
      Parameters:
      index - the index in the paste stack (0 = most recent)
      Returns:
      the text buffer at the specified index, or the oldest entry if index is out of bounds