Package org.jline.reader.impl.completer
Class ArgumentCompleter.ArgumentLine
java.lang.Object
org.jline.reader.impl.completer.ArgumentCompleter.ArgumentLine
- All Implemented Interfaces:
ParsedLine
- Enclosing class:
ArgumentCompleter
A simple implementation of ParsedLine for argument completion.
This class represents a single word with a cursor position, used for completing arguments in the ArgumentCompleter.
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentLine
(String word, int cursor) Creates a new ArgumentLine with the specified word and cursor position. -
Method Summary
-
Constructor Details
-
ArgumentLine
Creates a new ArgumentLine with the specified word and cursor position.- Parameters:
word
- the word being completedcursor
- the cursor position within the word
-
-
Method Details
-
word
Description copied from interface:ParsedLine
The current word being completed. If the cursor is after the last word, an empty string is returned.- Specified by:
word
in interfaceParsedLine
- Returns:
- the word being completed or an empty string
-
wordCursor
public int wordCursor()Description copied from interface:ParsedLine
The cursor position within the current word.- Specified by:
wordCursor
in interfaceParsedLine
- Returns:
- the cursor position within the current word
-
wordIndex
public int wordIndex()Description copied from interface:ParsedLine
The index of the current word in the list of words.- Specified by:
wordIndex
in interfaceParsedLine
- Returns:
- the index of the current word in the list of words
-
words
Description copied from interface:ParsedLine
The list of words.- Specified by:
words
in interfaceParsedLine
- Returns:
- the list of words
-
line
Description copied from interface:ParsedLine
The unparsed line.- Specified by:
line
in interfaceParsedLine
- Returns:
- the unparsed line
-
cursor
public int cursor()Description copied from interface:ParsedLine
The cursor position within the line.- Specified by:
cursor
in interfaceParsedLine
- Returns:
- the cursor position within the line
-