Modifier and Type | Class and Description |
---|---|
static class |
AutocompleteEngine.Builder<T extends Indexable>
Builder for constructing
AutocompleteEngine instances. |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T element)
Indexes a single element.
|
boolean |
addAll(Collection<T> elements)
Indexes a collection of elements.
|
boolean |
remove(T element)
Removes a single element.
|
boolean |
removeAll(Collection<T> elements)
Removes a collection of elements.
|
List<T> |
search(String query)
Returns a
List of all elements that match a query, sorted
according to the default comparator. |
List<T> |
search(String query,
int limit)
Returns a
List of the top elements that match a query, sorted
according to the default comparator. |
public boolean add(T element)
NullPointerException
- if element
is null;public boolean addAll(Collection<T> elements)
NullPointerException
- if elements
is null or contains a null element;public boolean remove(T element)
NullPointerException
- if element
is null;public boolean removeAll(Collection<T> elements)
NullPointerException
- if elements
is null or contains a null element;public List<T> search(String query)
List
of all elements that match a query, sorted
according to the default comparator.NullPointerException
- if query
is null;public List<T> search(String query, int limit)
List
of the top elements that match a query, sorted
according to the default comparator.NullPointerException
- if query
is null;IllegalArgumentException
- if limit
is negative;Copyright © 2017. All rights reserved.