jline

Class SimpleCompletor

public class SimpleCompletor extends Object implements Completor, Cloneable

A simple Completor implementation that handles a pre-defined list of completion words.

Example usage:

  myConsoleReader.addCompletor (new SimpleCompletor (new String [] { "now", "yesterday", "tomorrow" }));
  

Author: Marc Prud'hommeaux

Nested Class Summary
static classSimpleCompletor.NoOpFilter
static interfaceSimpleCompletor.SimpleCompletorFilter
Filter for elements in the completor.
Constructor Summary
SimpleCompletor(String candidateString)
Create a new SimpleCompletor with a single possible completion values.
SimpleCompletor(String[] candidateStrings)
Create a new SimpleCompletor with a list of possible completion values.
SimpleCompletor(String[] strings, SimpleCompletor.SimpleCompletorFilter filter)
SimpleCompletor(Reader reader)
Complete candidates using the contents of the specified Reader.
SimpleCompletor(InputStream in)
Complete candidates using the whitespearated values in read from the specified Reader.
Method Summary
voidaddCandidateString(String candidateString)
Objectclone()
intcomplete(String buffer, int cursor, List clist)
SortedSetgetCandidates()
StringgetDelimiter()
voidsetCandidates(SortedSet candidates)
voidsetCandidateStrings(String[] strings)
voidsetDelimiter(String delimiter)

Constructor Detail

SimpleCompletor

public SimpleCompletor(String candidateString)
Create a new SimpleCompletor with a single possible completion values.

SimpleCompletor

public SimpleCompletor(String[] candidateStrings)
Create a new SimpleCompletor with a list of possible completion values.

SimpleCompletor

public SimpleCompletor(String[] strings, SimpleCompletor.SimpleCompletorFilter filter)

SimpleCompletor

public SimpleCompletor(Reader reader)
Complete candidates using the contents of the specified Reader.

SimpleCompletor

public SimpleCompletor(InputStream in)
Complete candidates using the whitespearated values in read from the specified Reader.

Method Detail

addCandidateString

public void addCandidateString(String candidateString)

clone

public Object clone()

complete

public int complete(String buffer, int cursor, List clist)

getCandidates

public SortedSet getCandidates()

getDelimiter

public String getDelimiter()

setCandidates

public void setCandidates(SortedSet candidates)

setCandidateStrings

public void setCandidateStrings(String[] strings)

setDelimiter

public void setDelimiter(String delimiter)
Copyright © 2002-2009 null. All Rights Reserved.