org.xnap.cmdl
Class DefaultCompleter
java.lang.Object
org.xnap.cmdl.DefaultCompleter
- All Implemented Interfaces:
- Completer
public class DefaultCompleter
- extends java.lang.Object
- implements Completer
Method Summary |
void |
add(java.lang.String completion)
|
java.lang.String |
completer(java.lang.String text,
int state)
Returns a possible completion for text . |
java.lang.String[] |
getCompletions()
|
void |
remove(java.lang.String completion)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCompleter
public DefaultCompleter()
add
public void add(java.lang.String completion)
remove
public void remove(java.lang.String completion)
getCompletions
public java.lang.String[] getCompletions()
completer
public java.lang.String completer(java.lang.String text,
int state)
- Description copied from interface:
Completer
- Returns a possible completion for
text
.
- Specified by:
completer
in interface Completer
- Parameters:
text
- the start of the word to be completedstate
- 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:
ReadlineCompleter
Copyright © 2001-2005 XNap Team. All Rights Reserved.