Class ActionDecoder
java.lang.Object
org.aesh.readline.action.ActionDecoder
Decodes input key sequences and maps them to corresponding actions.
- Author:
- Ståle W. Pedersen
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a decoder with default key mappings.ActionDecoder(EditMode editMode) Creates a decoder with key mappings from the specified edit mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int input) Adds a single input code point to the decoder buffer.voidadd(int[] input) Adds input code points to the decoder buffer.booleanhasNext()Checks if there is another action available.next()Returns and removes the next action from the queue.peek()Returns the next action without removing it from the queue.voidsetMappings(EditMode editMode) Updates the key mappings from the specified edit mode.
-
Constructor Details
-
ActionDecoder
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
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
Returns and removes the next action from the queue.- Returns:
- the next key action
-
setMappings
Updates the key mappings from the specified edit mode.- Parameters:
editMode- the edit mode providing new key mappings
-