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 classSimpleCompletor.NoOpFilterstatic interfaceSimpleCompletor.SimpleCompletorFilterFilter 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 voidadd(java.lang.String candidate)voidaddCandidateString(java.lang.String candidateString)java.lang.Objectclone()intcomplete(java.lang.String buffer, int cursor, java.util.List clist)java.util.SortedSetgetCandidates()java.lang.StringgetDelimiter()java.lang.ObjectleftShift(java.lang.String s)voidsetCandidates(java.util.SortedSet candidates)voidsetCandidateStrings(java.lang.String[] strings)voidsetDelimiter(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.IOExceptionComplete candidates using the contents of the specified Reader.- Throws:
java.io.IOException
-
SimpleCompletor
public SimpleCompletor(java.io.InputStream in) throws java.io.IOExceptionComplete 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:
completein 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:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-