Package test
Class TestCompleter
- java.lang.Object
-
- test.TestCompleter
-
- All Implemented Interfaces:
ReadlineCompleter
public class TestCompleter extends java.lang.Object implements ReadlineCompleter
This class is a sample custom completer. If you press the TAB-key at the readline prompt, you will see the two possible completions ("Linux" and "Tux"). Once you have entered a "L" or a "T", you will only see the respective single possible completion. In any other case, null is returned to signal that no (more) completions are available.- Version:
- $Revision$
- Author:
- $Author$
-
-
Constructor Summary
Constructors Constructor Description TestCompleter()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
completer(java.lang.String t, int s)
Return possible completion.
-
-
-
Method Detail
-
completer
public java.lang.String completer(java.lang.String t, int s)
Return possible completion. Implements org.gnu.readline.ReadlineCompleter.- Specified by:
completer
in interfaceReadlineCompleter
- Parameters:
t
- start of completion text. This is the text since the last word break character.s
- 0 or positive int. This state is zero on the first call for a completion request and increments for each subsequent call until the end of choices is reached.- Returns:
- String with a completion choice or
null
, if there are no more choices. - See Also:
Readline.getWordBreakCharacters()
,TestCompleter
-
-