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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Eat(int index)Gets the element in the input at the given 0-based index.static SimilarityInput<java.lang.Character>input(java.lang.CharSequence cs)Creates a new input for aCharSequence.static <T> SimilarityInput<T>input(java.lang.Object input)Creates a new input for aCharSequenceorSimilarityInput.intlength()Gets the length of the input.
-
-
-
Method Detail
-
input
static SimilarityInput<java.lang.Character> input(java.lang.CharSequence cs)
Creates a new input for aCharSequence.- Parameters:
cs- input character sequence.- Returns:
- a new input.
-
input
static <T> SimilarityInput<T> input(java.lang.Object input)
Creates a new input for aCharSequenceorSimilarityInput.- Type Parameters:
T- The type of similarity score unit.- Parameters:
input- character sequence or similarity input.- Returns:
- a new input.
- Throws:
java.lang.IllegalArgumentException- when the input type is neitherCharSequenceorSimilarityInput.
-
at
E at(int index)
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.
-
-