|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjline.SimpleCompletor
public class 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. |
Constructor Summary | |
---|---|
SimpleCompletor(java.io.InputStream in)
Complete candidates using the whitespearated values in read from the specified Reader. |
|
SimpleCompletor(java.io.Reader reader)
Complete candidates using the contents of the specified Reader. |
|
SimpleCompletor(java.lang.String candidateString)
Create a new SimpleCompletor with a single possible completion values. |
|
SimpleCompletor(java.lang.String[] candidateStrings)
Create a new SimpleCompletor with a list of possible completion values. |
|
SimpleCompletor(java.lang.String[] strings,
SimpleCompletor.SimpleCompletorFilter filter)
|
Method Summary | |
---|---|
void |
addCandidateString(java.lang.String candidateString)
|
java.lang.Object |
clone()
|
int |
complete(java.lang.String buffer,
int cursor,
java.util.List clist)
Populates candidates with a list of possible completions for the buffer. |
java.util.SortedSet |
getCandidates()
|
java.lang.String |
getDelimiter()
|
void |
setCandidates(java.util.SortedSet candidates)
|
void |
setCandidateStrings(java.lang.String[] strings)
|
void |
setDelimiter(java.lang.String delimiter)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleCompletor(java.lang.String candidateString)
public SimpleCompletor(java.lang.String[] candidateStrings)
public SimpleCompletor(java.lang.String[] strings, SimpleCompletor.SimpleCompletorFilter filter)
public SimpleCompletor(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public SimpleCompletor(java.io.InputStream in) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public int complete(java.lang.String buffer, int cursor, java.util.List clist)
Completor
List
before returning.
complete
in interface Completor
buffer
- the bufferclist
- the List
of candidates to populate
public void setDelimiter(java.lang.String delimiter)
public java.lang.String getDelimiter()
public void setCandidates(java.util.SortedSet candidates)
public java.util.SortedSet getCandidates()
public void setCandidateStrings(java.lang.String[] strings)
public void addCandidateString(java.lang.String candidateString)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |