Class SimpleCompletor
- java.lang.Object
-
- org.codehaus.groovy.tools.shell.util.SimpleCompletor
-
- All Implemented Interfaces:
java.lang.Cloneable
,jline.console.completer.Completer
public class SimpleCompletor extends java.lang.Object implements jline.console.completer.Completer, java.lang.Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleCompletor.NoOpFilter
static interface
SimpleCompletor.SimpleCompletorFilter
Filter for elements in the completor.
-
Constructor Summary
Constructors Constructor Description SimpleCompletor()
SimpleCompletor(Closure loader)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String candidate)
void
addCandidateString(java.lang.String candidateString)
java.lang.Object
clone()
int
complete(java.lang.String buffer, int cursor, java.util.List clist)
java.util.SortedSet
getCandidates()
java.lang.String
getDelimiter()
java.lang.Object
leftShift(java.lang.String s)
void
setCandidates(java.util.SortedSet candidates)
void
setCandidateStrings(java.lang.String[] strings)
void
setDelimiter(java.lang.String delimiter)
-
-
-
Constructor Detail
-
SimpleCompletor
public SimpleCompletor()
-
SimpleCompletor
public SimpleCompletor(java.lang.String candidateString)
Create a new SimpleCompletor with a single possible completion values.
-
SimpleCompletor
public SimpleCompletor(java.lang.String[] candidateStrings)
Create a new SimpleCompletor with a list of possible completion values.
-
SimpleCompletor
public SimpleCompletor(java.lang.String[] strings, SimpleCompletor.SimpleCompletorFilter filter)
-
SimpleCompletor
public SimpleCompletor(java.io.Reader reader) throws java.io.IOException
Complete candidates using the contents of the specified Reader.- Throws:
java.io.IOException
-
SimpleCompletor
public SimpleCompletor(java.io.InputStream in) throws java.io.IOException
Complete candidates using the whitespearated values in read from the specified Reader.- Throws:
java.io.IOException
-
SimpleCompletor
public SimpleCompletor(Closure loader)
-
-
Method Detail
-
add
public void add(java.lang.String candidate)
-
leftShift
public java.lang.Object leftShift(java.lang.String s)
-
complete
public int complete(java.lang.String buffer, int cursor, java.util.List clist)
- Specified by:
complete
in interfacejline.console.completer.Completer
-
setDelimiter
public void setDelimiter(java.lang.String delimiter)
-
getDelimiter
public java.lang.String getDelimiter()
-
setCandidates
public void setCandidates(java.util.SortedSet candidates)
-
getCandidates
public java.util.SortedSet getCandidates()
-
setCandidateStrings
public void setCandidateStrings(java.lang.String[] strings)
-
addCandidateString
public void addCandidateString(java.lang.String candidateString)
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-