Class ActionDecoder

java.lang.Object
org.aesh.readline.action.ActionDecoder

public class ActionDecoder extends Object
Decodes input key sequences and maps them to corresponding actions.
Author:
Ståle W. Pedersen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a decoder with default key mappings.
    Creates a decoder with key mappings from the specified edit mode.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int input)
    Adds a single input code point to the decoder buffer.
    void
    add(int[] input)
    Adds input code points to the decoder buffer.
    boolean
    Checks if there is another action available.
    Returns and removes the next action from the queue.
    Returns the next action without removing it from the queue.
    void
    Updates the key mappings from the specified edit mode.

    Methods inherited from class Object

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

    • ActionDecoder

      public ActionDecoder(EditMode editMode)
      Creates a decoder with key mappings from the specified edit mode.
      Parameters:
      editMode - the edit mode providing key mappings
    • ActionDecoder

      public ActionDecoder()
      Creates a decoder with default key mappings.
  • Method Details

    • add

      public void add(int[] input)
      Adds input code points to the decoder buffer.
      Parameters:
      input - the array of code points to add
    • add

      public void add(int input)
      Adds a single input code point to the decoder buffer.
      Parameters:
      input - the code point to add
    • peek

      public KeyAction peek()
      Returns the next action without removing it from the queue.
      Returns:
      the next key action, or null if none available
    • hasNext

      public boolean hasNext()
      Checks if there is another action available.
      Returns:
      true if another action is available
    • next

      public KeyAction next()
      Returns and removes the next action from the queue.
      Returns:
      the next key action
    • setMappings

      public void setMappings(EditMode editMode)
      Updates the key mappings from the specified edit mode.
      Parameters:
      editMode - the edit mode providing new key mappings