E - the type of elements contained in the listspublic interface MultisetDistance<E> extends Distance<com.google.common.collect.Multiset<E>>
The elements in the multisets have to implement Object.hashCode() and
Object.equals(Object).
The elements in the multisets may not be null if metric does not support null values.
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 multisets. Multisets
should be treated as if wrapped by
Multisets.unmodifiableMultiset(Multiset).
| Modifier and Type | Method and Description |
|---|---|
float |
distance(com.google.common.collect.Multiset<E> a,
com.google.common.collect.Multiset<E> b)
Measures the distance between multisets a and b.
|
float distance(com.google.common.collect.Multiset<E> a, com.google.common.collect.Multiset<E> b)
0.0 indicates that a
and b are similar.
Results are undefined if a and b are based on different
equivalence relations (as HashMultiset and TreeMultiset
are).
distance in interface Distance<com.google.common.collect.Multiset<E>>a - list a to compareb - list b to compareNullPointerException - when either a or b is nullCopyright © 2014–2016. All rights reserved.