Package com.marcpg.libpg.text
Class Completer
java.lang.Object
com.marcpg.libpg.text.Completer
Used for autocompletion, suggestions and search.
- Since:
- 0.0.1
-
Method Summary
Modifier and TypeMethodDescriptioncontainComplete
(String input, @NotNull Collection<String> suggested) Filter suggestions based on what was already typed.containComplete
(String input, String[] suggested) Filter suggestions based on what was already typed.semiSmartComplete
(@NotNull String input, String[] suggested) Filter suggestions based on what was already typed.semiSmartComplete
(@NotNull String input, Collection<String> suggested) Filter suggestions based on what was already typed.startComplete
(String input, @NotNull Collection<String> suggested) Filter suggestions based on what was already typed.startComplete
(String input, String[] suggested) Filter suggestions based on what was already typed.
-
Method Details
-
startComplete
public static List<String> startComplete(String input, @NotNull @NotNull Collection<String> suggested) Filter suggestions based on what was already typed.
If suggested has "max", "cat", "thomas" and "mouse" in it,
input = "c" would suggest "cat"
input = "m" would suggest "mouse" and "max"- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - See Also:
-
startComplete
Filter suggestions based on what was already typed.
If suggested has "max", "cat", "thomas" and "mouse" in it,
input = "c" would suggest "cat"
input = "m" would suggest "mouse" and "max"- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - See Also:
-
containComplete
public static List<String> containComplete(String input, @NotNull @NotNull Collection<String> suggested) Filter suggestions based on what was already typed.
If suggested has "max", "cat", "thomas" and "mouse" in it,
input = "c" would suggest "cat"
input = "m" would suggest "mouse", "max" and "thomas"- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - See Also:
-
containComplete
Filter suggestions based on what was already typed.
If suggested has "max", "cat", "thomas" and "mouse" in it,
input = "c" would suggest "cat"
input = "m" would suggest "mouse", "max" and "thomas"- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - See Also:
-
semiSmartComplete
public static List<String> semiSmartComplete(@NotNull @NotNull String input, Collection<String> suggested) Filter suggestions based on what was already typed.
CombinesstartComplete(String, Collection)
andcontainComplete(String, Collection)
.
If the length of the input is three characters or less, it will use start completion and if the input is over three characters long, it will use contain completion.
This ensures that the amount of suggested strings is limited and doesn't reach too high numbers.- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - Since:
- 0.0.2
- See Also:
-
semiSmartComplete
Filter suggestions based on what was already typed.
CombinesstartComplete(String, String[])
andcontainComplete(String, String[])
.
If the length of the input is three characters or less, it will use start completion and if the input is over three characters long, it will use contain completion.
This ensures that the amount of suggested strings is limited and doesn't reach too high numbers.- Parameters:
input
- What was already typedsuggested
- All things that can be suggested- Returns:
- A
list
of filtered suggestions based on input and suggested - Since:
- 0.0.2
- See Also:
-