|
|||||||||
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" }));
Nested Class Summary | |
static class |
SimpleCompletor.NoOpFilter
|
static interface |
SimpleCompletor.SimpleCompletorFilter
Filter for elements in the completor. |
Field Summary | |
(package private) SortedSet |
candidates
The list of candidates that will be completed. |
(package private) String |
delimiter
A delimiter to use to qualify completions. |
(package private) SimpleCompletor.SimpleCompletorFilter |
filter
|
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. |
|
SimpleCompletor(String[] strings,
SimpleCompletor.SimpleCompletorFilter filter)
|
Method Summary | |
void |
addCandidateString(String candidateString)
|
Object |
clone()
|
int |
complete(String buffer,
int cursor,
List clist)
Populates candidates with a list of possible completions for the buffer. |
SortedSet |
getCandidates()
|
String |
getDelimiter()
|
void |
setCandidates(SortedSet candidates)
|
void |
setCandidateStrings(String[] strings)
|
void |
setDelimiter(String delimiter)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
SortedSet candidates
String delimiter
final SimpleCompletor.SimpleCompletorFilter filter
Constructor Detail |
public SimpleCompletor(String candidateString)
public SimpleCompletor(String[] candidateStrings)
public SimpleCompletor(String[] strings, SimpleCompletor.SimpleCompletorFilter filter)
public SimpleCompletor(Reader reader) throws IOException
public SimpleCompletor(InputStream in) throws IOException
Method Detail |
public int complete(String buffer, int cursor, List clist)
Completor
List
before returning.
complete
in interface Completor
buffer
- the bufferclist
- the List
of candidates to populate
public void setDelimiter(String delimiter)
public String getDelimiter()
public void setCandidates(SortedSet candidates)
public SortedSet getCandidates()
public void setCandidateStrings(String[] strings)
public void addCandidateString(String candidateString)
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |