E - the type of elements contained in the listspublic interface SetDistance<E> extends Distance<Set<E>>
The elements in the sets have to implement Object.hashCode() and
Object.equals(Object).
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).
Implementations may not modify the contents of the sets. List should be
treated as if wrapped by Collections.unmodifiableSet(Set).
| Modifier and Type | Method and Description |
|---|---|
float |
distance(Set<E> a,
Set<E> b)
Measures the distance between sets a and b.
|
float distance(Set<E> a, Set<E> b)
0.0 indicates that a and
b are similar.
Results are undefined if a and b are sets based on
different equivalence relations (as HashSet, TreeSet, and
the keySet of an IdentityHashMap all are).
distance in interface Distance<Set<E>>a - set a to compareb - set b to compareNullPointerException - when either a or b is nullCopyright © 2014–2016. All rights reserved.