Package com.plotsquared.core.util
Class StringComparison<T>
java.lang.Object
com.plotsquared.core.util.StringComparison<T>
String comparison library.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionYou 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 intCompare two stringsGet the best match valueWill return both the match number, and the actual match stringGet the objectvoidstatic String[]sLetterPair(String s)Get an array containing letter pairswLetterPair(String s)Create 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
-