public interface StringDistance extends Distance<String>
The distance measure should be consistent with equals such that
a.equals(b) =>
distance(a,b) == 0.0.
The distance measure should be reflexive such that
distance(a,a) == 0.0.
The distance measure should be symmetric such that
distance(a,b) == distance(b,a).
The distance measure may be transitive such that
distance(a, c) ≤ distance(a, b) +
distance(b, c)
The distance measure may satisfy the coincidence axiom such that
compare(a, b) = 0 if and only if a.equals(b)
| Modifier and Type | Method and Description |
|---|---|
float |
distance(String a,
String b)
Measures the distance between string a and b.
|
float distance(String a, String b)
0.0 indicates that a and
b are similar.distance in interface Distance<String>a - string a to compareb - string b to compareNullPointerException - when either a or b is nullCopyright © 2014–2018. All rights reserved.