Package com.plotsquared.core.util
Class StringComparison<T>
java.lang.Object
com.plotsquared.core.util.StringComparison<T>
String comparison library.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionYou should call init(...) when you are ready to get a String comparison value.StringComparison
(String input, Collection<T> objects) StringComparison
(String input, Collection<T> objects, Function<T, String> toString) StringComparison
(String input, T[] objects) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Compare two stringsGet the best match valueWill return both the match number, and the actual match stringGet the objectvoid
static String[]
Get an array containing letter pairsCreate an ArrayList containing pairs of letters
-
Constructor Details
-
StringComparison
Constructor- Parameters:
input
- Input Base Valueobjects
- Objects to compare
-
StringComparison
-
StringComparison
-
StringComparison
-
StringComparison
public StringComparison()You should call init(...) when you are ready to get a String comparison value.
-
-
Method Details
-
compare
Compare two strings- Parameters:
s1
- String Bases2
- Object- Returns:
- match
-
wLetterPair
Create an ArrayList containing pairs of letters- Parameters:
s
- string to split- Returns:
- ArrayList
-
sLetterPair
Get an array containing letter pairs- Parameters:
s
- string to split- Returns:
- Array
-
init
-
getString
-
getMatchObject
Get the object- Returns:
- match object
-
getBestMatch
Get the best match value- Returns:
- match value
-
getBestMatchAdvanced
Will return both the match number, and the actual match string- Returns:
- object[] containing: double, String
-