jline.console.completer
Class StringsCompleter

java.lang.Object
  extended by jline.console.completer.StringsCompleter
All Implemented Interfaces:
Completer
Direct Known Subclasses:
EnumCompleter

public class StringsCompleter
extends java.lang.Object
implements Completer

Completer for a set of strings.

Since:
2.3
Author:
Jason Dillon

Constructor Summary
StringsCompleter()
           
StringsCompleter(java.util.Collection<java.lang.String> strings)
           
StringsCompleter(java.lang.String... strings)
           
 
Method Summary
 int complete(java.lang.String buffer, int cursor, java.util.List<java.lang.CharSequence> candidates)
          Populates candidates with a list of possible completions for the buffer.
 java.util.Collection<java.lang.String> getStrings()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringsCompleter

public StringsCompleter()

StringsCompleter

public StringsCompleter(java.util.Collection<java.lang.String> strings)

StringsCompleter

public StringsCompleter(java.lang.String... strings)
Method Detail

getStrings

public java.util.Collection<java.lang.String> getStrings()

complete

public int complete(java.lang.String buffer,
                    int cursor,
                    java.util.List<java.lang.CharSequence> candidates)
Description copied from interface: Completer
Populates candidates with a list of possible completions for the buffer. The candidates list will not be sorted before being displayed to the user: thus, the complete method should sort the List before returning.

Specified by:
complete in interface Completer
Parameters:
buffer - The buffer
cursor - The current position of the cursor in the buffer
candidates - The List of candidates to populate
Returns:
The index of the buffer for which the completion will be relative


Copyright © 2008-2011 Sonatype. All Rights Reserved.