- java.lang.Object
-
- org.jline.reader.impl.DefaultParser.ArgumentList
-
- All Implemented Interfaces:
CompletingParsedLine,ParsedLine
- Enclosing class:
- DefaultParser
public class DefaultParser.ArgumentList extends Object implements ParsedLine, CompletingParsedLine
The result of a delimited buffer.- Author:
- Marc Prud'hommeaux
-
-
Constructor Summary
Constructors Constructor Description ArgumentList(String line, List<String> words, int wordIndex, int wordCursor, int cursor)Deprecated.ArgumentList(String line, List<String> words, int wordIndex, int wordCursor, int cursor, String openingQuote, int rawWordCursor, int rawWordLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcursor()The cursor position within the line.CharSequenceescape(CharSequence candidate, boolean complete)Stringline()The unparsed line.intrawWordCursor()intrawWordLength()Stringword()The current word being completed.intwordCursor()The cursor position within the current word.intwordIndex()The index of the current word in the list of words.List<String>words()The list of words.
-
-
-
Constructor Detail
-
ArgumentList
@Deprecated public ArgumentList(String line, List<String> words, int wordIndex, int wordCursor, int cursor)
Deprecated.
-
ArgumentList
public ArgumentList(String line, List<String> words, int wordIndex, int wordCursor, int cursor, String openingQuote, int rawWordCursor, int rawWordLength)
- Parameters:
line- the command line being editedwords- the list of wordswordIndex- the index of the current word in the list of wordswordCursor- the cursor position within the current wordcursor- the cursor position within the lineopeningQuote- the opening quote (usually '\"' or '\'') or nullrawWordCursor- the cursor position inside the raw word (i.e. including quotes and escape characters)rawWordLength- the raw word length, including quotes and escape characters
-
-
Method Detail
-
wordIndex
public int wordIndex()
Description copied from interface:ParsedLineThe index of the current word in the list of words.- Specified by:
wordIndexin interfaceParsedLine- Returns:
- the index of the current word in the list of words
-
word
public String word()
Description copied from interface:ParsedLineThe current word being completed. If the cursor is after the last word, an empty string is returned.- Specified by:
wordin interfaceParsedLine- Returns:
- the word being completed or an empty string
-
wordCursor
public int wordCursor()
Description copied from interface:ParsedLineThe cursor position within the current word.- Specified by:
wordCursorin interfaceParsedLine- Returns:
- the cursor position within the current word
-
words
public List<String> words()
Description copied from interface:ParsedLineThe list of words.- Specified by:
wordsin interfaceParsedLine- Returns:
- the list of words
-
cursor
public int cursor()
Description copied from interface:ParsedLineThe cursor position within the line.- Specified by:
cursorin interfaceParsedLine- Returns:
- the cursor position within the line
-
line
public String line()
Description copied from interface:ParsedLineThe unparsed line.- Specified by:
linein interfaceParsedLine- Returns:
- the unparsed line
-
escape
public CharSequence escape(CharSequence candidate, boolean complete)
- Specified by:
escapein interfaceCompletingParsedLine
-
rawWordCursor
public int rawWordCursor()
- Specified by:
rawWordCursorin interfaceCompletingParsedLine
-
rawWordLength
public int rawWordLength()
- Specified by:
rawWordLengthin interfaceCompletingParsedLine
-
-