|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jline.SimpleCompletor
A simple Completor implementation that handles a pre-defined
list of completion words.
Example usage:
myConsoleReader.addCompletor (new SimpleCompletor (new String [] { "now", "yesterday", "tomorrow" }));
| Field Summary | |
(package private) String[] |
candidateStrings
The list of candidates that will be completed. |
| Constructor Summary | |
SimpleCompletor(InputStream in)
Complete 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. |
|
| Method Summary | |
void |
addCandidateString(String candidateString)
|
int |
complete(String buffer,
int cursor,
List candidates)
Populates candidates with a list of possible completions for the buffer. |
String[] |
getCandidateStrings()
Returns the list of candidate Strings. |
void |
setCandidateStrings(String[] candidateStrings)
Set the list of candidate Strings. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
String[] candidateStrings
| Constructor Detail |
public SimpleCompletor(String candidateString)
public SimpleCompletor(String[] candidateStrings)
public SimpleCompletor(Reader reader)
throws IOException
public SimpleCompletor(InputStream in)
throws IOException
| Method Detail |
public int complete(String buffer,
int cursor,
List candidates)
CompletorList before returning.
complete in interface Completorbuffer - the buffercandidates - the List of candidates to populate
public void setCandidateStrings(String[] candidateStrings)
public String[] getCandidateStrings()
public void addCandidateString(String candidateString)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||