Class Completers.RegexCompleter.ArgumentLine
java.lang.Object
org.jline.builtins.Completers.RegexCompleter.ArgumentLine
- All Implemented Interfaces:
org.jline.reader.ParsedLine
- Enclosing class:
Completers.RegexCompleter
public static class Completers.RegexCompleter.ArgumentLine
extends Object
implements org.jline.reader.ParsedLine
A simple implementation of ParsedLine for argument completion.
This class represents a single word with a cursor position, used for completing arguments in the RegexCompleter.
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentLine(String word, int cursor) Creates a new ArgumentLine with the specified word and cursor position. -
Method Summary
Modifier and TypeMethodDescriptionintcursor()Gets the cursor position within the line.line()Gets the full line, which is the same as the current word.word()Gets the current word.intGets the cursor position within the current word.intGets the index of the current word, which is always 0 for ArgumentLine.words()Gets the list of words, which contains only the current word.
-
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
Gets the current word.- Specified by:
wordin interfaceorg.jline.reader.ParsedLine- Returns:
- the current word
-
wordCursor
public int wordCursor()Gets the cursor position within the current word.- Specified by:
wordCursorin interfaceorg.jline.reader.ParsedLine- Returns:
- the cursor position
-
wordIndex
public int wordIndex()Gets the index of the current word, which is always 0 for ArgumentLine.- Specified by:
wordIndexin interfaceorg.jline.reader.ParsedLine- Returns:
- always returns 0
-
words
-
line
Gets the full line, which is the same as the current word.- Specified by:
linein interfaceorg.jline.reader.ParsedLine- Returns:
- the current word
-
cursor
public int cursor()Gets the cursor position within the line.- Specified by:
cursorin interfaceorg.jline.reader.ParsedLine- Returns:
- the cursor position
-