Interface SimilarityInput<E>
- Type Parameters:
E
- the type of elements in this input.
public interface SimilarityInput<E>
An ordered input of elements used to compute a similarity score.
You can implement a SimilarityInput on a domain object instead of CharSequence where implementing CharSequence does not make sense.
- Since:
- 1.13.0
-
Method Summary
Modifier and TypeMethodDescriptionat
(int index) Gets the element in the input at the given 0-based index.static SimilarityInput<Character>
input
(CharSequence cs) Creates a new input for aCharSequence
.static <T> SimilarityInput<T>
Creates a new input for aCharSequence
orSimilarityInput
.int
length()
Gets the length of the input.
-
Method Details
-
input
Creates a new input for aCharSequence
.- Parameters:
cs
- input character sequence.- Returns:
- a new input.
-
input
Creates a new input for aCharSequence
orSimilarityInput
.- Type Parameters:
T
- The type of similarity score unit.- Parameters:
input
- character sequence or similarity input.- Returns:
- a new input.
- Throws:
IllegalArgumentException
- when the input type is neitherCharSequence
orSimilarityInput
.
-
at
Gets the element in the input at the given 0-based index.- Parameters:
index
- a 0-based index.- Returns:
- the element in the input at the given 0-based index.
-
length
int length()Gets the length of the input.- Returns:
- the length of the input.
-