public class CompletionMatcherImpl extends Object implements CompletionMatcher
| Modifier and Type | Field and Description |
|---|---|
protected Predicate<String> |
exact |
protected List<Function<Map<String,List<Candidate>>,Map<String,List<Candidate>>>> |
matchers |
| Constructor and Description |
|---|
CompletionMatcherImpl() |
| Modifier and Type | Method and 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 functions
|
protected void |
defaultMatchers(Map<LineReader.Option,Boolean> options,
boolean prefix,
CompletingParsedLine line,
boolean caseInsensitive,
int errors,
String originalGroupName)
Default JLine matchers
|
Candidate |
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) |
protected void reset(boolean caseInsensitive)
public void compile(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
CompletionMatchercompile in interface CompletionMatcheroptions - 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-namepublic List<Candidate> matches(List<Candidate> candidates)
matches in interface CompletionMatchercandidates - list of candidatespublic Candidate exactMatch()
exactMatch in interface CompletionMatcherpublic String getCommonPrefix()
getCommonPrefix in interface CompletionMatcherprotected void defaultMatchers(Map<LineReader.Option,Boolean> options, boolean prefix, CompletingParsedLine line, boolean caseInsensitive, int errors, String originalGroupName)
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)
Copyright © 2023. All rights reserved.