Class History

java.lang.Object
org.basex.util.History

public final class History extends Object
This class stores strings in a history.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Summary

    Constructors
    Constructor
    Description
    History(byte[] text)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates if the history is active.
    int
    Returns the caret position.
    boolean
    Checks if the history points to the first entry.
    void
    init(byte[] text)
    Initializes the history with a text.
    boolean
    Checks if the history points to the last entry.
    boolean
    Checks if the file has been modified.
    byte[]
    Returns the next string and increases the pointer, or returns null.
    byte[]
    Returns the previous string and decreases the pointer, or returns null.
    void
    Sets the saved position.
    void
    store(byte[] str, int oc, int nc)
    Stores a string in the history.

    Methods inherited from class java.lang.Object

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

    • History

      public History(byte[] text)
      Constructor.
      Parameters:
      text - initial text
  • Method Details

    • init

      public void init(byte[] text)
      Initializes the history with a text.
      Parameters:
      text - initial text
    • active

      public boolean active()
      Indicates if the history is active.
      Returns:
      result of check
    • first

      public boolean first()
      Checks if the history points to the first entry.
      Returns:
      result of check
    • last

      public boolean last()
      Checks if the history points to the last entry.
      Returns:
      result of check
    • prev

      public byte[] prev()
      Returns the previous string and decreases the pointer, or returns null.
      Returns:
      previous string or null
    • next

      public byte[] next()
      Returns the next string and increases the pointer, or returns null.
      Returns:
      previous string or null
    • caret

      public int caret()
      Returns the caret position.
      Returns:
      caret position
    • store

      public void store(byte[] str, int oc, int nc)
      Stores a string in the history.
      Parameters:
      str - string to be stored
      oc - old caret position
      nc - new caret position
    • save

      public void save()
      Sets the saved position.
    • modified

      public boolean modified()
      Checks if the file has been modified.
      Returns:
      result of check