T - the type of elements contained in the setspublic interface MultisetMetric<T> extends Metric<com.google.common.collect.Multiset<T>>
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 similarity measure should be consistent with equals such that
a.equals(b) => compare(a,b) == 1.0.
The similarity measure should be reflexive such that
compare(a,a) == 1.0.
The similarity measure should be symmetric such that
compare(a,b) == compare(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 |
compare(com.google.common.collect.Multiset<T> a,
com.google.common.collect.Multiset<T> b)
Measures the similarity between multisets a and b.
|
float compare(com.google.common.collect.Multiset<T> a, com.google.common.collect.Multiset<T> b)
Results are undefined if a and b are based on different
equivalence relations (as HashMultiset and TreeMultiset
are).
compare in interface Metric<com.google.common.collect.Multiset<T>>a - multisets a to compareb - multisets b to compareNullPointerException - when either a or b is nullCopyright © 2014–2016. All rights reserved.