Package jline
Class SimpleCompletor
java.lang.Object
jline.SimpleCompletor
- Direct Known Subclasses:
ClassNameCompletor
A simple Completor
implementation that handles a pre-defined
list of completion words.
Example usage:
myConsoleReader.addCompletor (new SimpleCompletor (new String [] { "now", "yesterday", "tomorrow" }));
- Author:
- Marc Prud'hommeaux
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
Filter for elements in the completor. -
Constructor Summary
ConstructorsConstructorDescriptionComplete candidates using the whitespearated values in read from the specified Reader.SimpleCompletor
(Reader reader) Complete candidates using the contents of the specified Reader.SimpleCompletor
(String candidateString) Create a new SimpleCompletor with a single possible completion values.SimpleCompletor
(String[] candidateStrings) Create a new SimpleCompletor with a list of possible completion values.SimpleCompletor
(String[] strings, SimpleCompletor.SimpleCompletorFilter filter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCandidateString
(String candidateString) clone()
int
Populates candidates with a list of possible completions for the buffer.void
setCandidates
(SortedSet candidates) void
setCandidateStrings
(String[] strings) void
setDelimiter
(String delimiter)
-
Constructor Details
-
SimpleCompletor
Create a new SimpleCompletor with a single possible completion values. -
SimpleCompletor
Create a new SimpleCompletor with a list of possible completion values. -
SimpleCompletor
-
SimpleCompletor
Complete candidates using the contents of the specified Reader.- Throws:
IOException
-
SimpleCompletor
Complete candidates using the whitespearated values in read from the specified Reader.- Throws:
IOException
-
-
Method Details
-
complete
Description copied from interface:Completor
Populates candidates with a list of possible completions for the buffer. The candidates list will not be sorted before being displayed to the user: thus, the complete method should sort theList
before returning. -
setDelimiter
-
getDelimiter
-
setCandidates
-
getCandidates
-
setCandidateStrings
-
addCandidateString
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-