- java.lang.Object
-
- org.jline.reader.impl.CompletionMatcherImpl
-
- All Implemented Interfaces:
CompletionMatcher
public class CompletionMatcherImpl extends Object implements CompletionMatcher
-
-
Constructor Summary
Constructors Constructor Description CompletionMatcherImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
camelMatch(String word, int i, String candidate, int j)
void
compile(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
Compiles completion matcher functionsprotected void
defaultMatchers(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
Default JLine matchersCandidate
exactMatch()
String
getCommonPrefix()
List<Candidate>
matches(List<Candidate> candidates)
protected void
reset(boolean caseInsensitive)
protected Function<Map<String,List<Candidate>>,Map<String,List<Candidate>>>
simpleMatcher(Predicate<String> predicate)
protected Function<Map<String,List<Candidate>>,Map<String,List<Candidate>>>
typoMatcher(String word, int errors, boolean caseInsensitive, String originalGroupName)
-
-
-
Method Detail
-
reset
protected void reset(boolean caseInsensitive)
-
compile
public void compile(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
Description copied from interface:CompletionMatcher
Compiles completion matcher functions- Specified by:
compile
in interfaceCompletionMatcher
- Parameters:
options
- LineReader optionsprefix
- invoked by complete-prefix or expand-or-complete-prefix widgetline
- The parsed line within which completion has been requestedcaseInsensitive
- if completion is case insensitive or noterrors
- number of errors accepted in matchingoriginalGroupName
- value of JLineReader variable original-group-name
-
matches
public List<Candidate> matches(List<Candidate> candidates)
- Specified by:
matches
in interfaceCompletionMatcher
- Parameters:
candidates
- list of candidates- Returns:
- a list of candidates that completion matcher matches
-
exactMatch
public Candidate exactMatch()
- Specified by:
exactMatch
in interfaceCompletionMatcher
- Returns:
- a candidate that have exact match, null if no exact match found
-
getCommonPrefix
public String getCommonPrefix()
- Specified by:
getCommonPrefix
in interfaceCompletionMatcher
- Returns:
- a common prefix of matched candidates
-
defaultMatchers
protected void defaultMatchers(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
Default JLine matchers
-
simpleMatcher
protected Function<Map<String,List<Candidate>>,Map<String,List<Candidate>>> simpleMatcher(Predicate<String> predicate)
-
typoMatcher
protected Function<Map<String,List<Candidate>>,Map<String,List<Candidate>>> typoMatcher(String word, int errors, boolean caseInsensitive, String originalGroupName)
-
-