org.xnap.cmdl
Class DefaultCompleter

java.lang.Object
  extended by org.xnap.cmdl.DefaultCompleter
All Implemented Interfaces:
Completer

public class DefaultCompleter
extends java.lang.Object
implements Completer


Constructor Summary
DefaultCompleter()
           
 
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
 

Constructor Detail

DefaultCompleter

public DefaultCompleter()
Method Detail

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 completed
state - 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.