Package autocomplete
Class TreeSetAutocomplete
- java.lang.Object
-
- autocomplete.TreeSetAutocomplete
-
- All Implemented Interfaces:
Autocomplete
public class TreeSetAutocomplete extends Object implements Autocomplete
TreeSet
implementation of theAutocomplete
interface.- See Also:
Autocomplete
-
-
Field Summary
Fields Modifier and Type Field Description private NavigableSet<CharSequence>
elements
NavigableSet
of added autocompletion terms.
-
Constructor Summary
Constructors Constructor Description TreeSetAutocomplete()
Constructs an empty instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(Collection<? extends CharSequence> terms)
Adds the given collection of autocompletion terms.List<CharSequence>
allMatches(CharSequence prefix)
Returns all autocompletion terms that match the given prefix.
-
-
-
Field Detail
-
elements
private final NavigableSet<CharSequence> elements
NavigableSet
of added autocompletion terms.
-
-
Method Detail
-
addAll
public void addAll(Collection<? extends CharSequence> terms)
Description copied from interface:Autocomplete
Adds the given collection of autocompletion terms.- Specified by:
addAll
in interfaceAutocomplete
- Parameters:
terms
- collection containing elements to be added.
-
allMatches
public List<CharSequence> allMatches(CharSequence prefix)
Description copied from interface:Autocomplete
Returns all autocompletion terms that match the given prefix.- Specified by:
allMatches
in interfaceAutocomplete
- Parameters:
prefix
- search query.
-
-