|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.moeaframework.util.OptionCompleter
public class OptionCompleter
Utility for auto-completion, finding the closest matching unique option from a set of options. For instance,
OptionCompleter completer = new OptionCompleter();
completer.add("subset");
completer.add("superset");
completer.lookup("sub"); // returns "subset"
completer.lookup("sup"); // returns "superset"
completer.lookup("s"); // returns null, since both subset and superset match
completer.lookup("k"); // returns null, no matches
| Constructor Summary | |
|---|---|
OptionCompleter()
Constructs a new, empty option auto-completer. |
|
OptionCompleter(Collection<String> options)
Constructs a new option auto-completer initialized to recognize the specified options. |
|
OptionCompleter(String... options)
Constructs a new option auto-completer initialized to recognize the specified options. |
|
| Method Summary | |
|---|---|
void |
add(String option)
Adds an option to this OptionCompleter. |
String |
lookup(String partial)
Returns the closest matching unique option from the set of options stored in this OptionCompleter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OptionCompleter()
public OptionCompleter(String... options)
options - the initial optionspublic OptionCompleter(Collection<String> options)
options - the initial options| Method Detail |
|---|
public void add(String option)
OptionCompleter. Duplicate options are
ignored.
option - the optionpublic String lookup(String partial)
OptionCompleter. Returns null if no options
matched or more than one option matched.
partial - the partial/complete option
null if no options
matched or more than one option matched
|
MOEA Framework 2.5 API Specification |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||