public class SimpleCompletor extends java.lang.Object implements Completor, java.lang.Cloneable
Completor
implementation that handles a pre-defined
list of completion words.
Example usage:
myConsoleReader.addCompletor (new SimpleCompletor (new Str [] { "now", "yesterday", "tomorrow" }));
Modifier and Type | Class and Description |
---|---|
static class |
SimpleCompletor.NoOpFilter |
static interface |
SimpleCompletor.SimpleCompletorFilter
Filter for elements in the completor.
|
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
void |
addCandidateString(java.lang.String candidateString) |
java.lang.Object |
clone() |
int |
complete(java.lang.String buffer,
int cursor,
java.util.List clist,
int matchessofar)
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) |
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
public int complete(java.lang.String buffer, int cursor, java.util.List clist, int matchessofar)
Completor
List
before returning.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
Copyright (c) 2014 Cloud Software Group, Inc. All rights reserved.