T
- the type of elements contained in the listspublic interface ListMetric<T> extends Metric<List<T>>
The elements in the lists have to implement Object.hashCode()
and
Object.equals(Object)
.
The elements in the lists 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 my not modify the contents of the list. List should be
treated as if wrapped by Collections.unmodifiableList(List)
.
Modifier and Type | Method and Description |
---|---|
float |
compare(List<T> a,
List<T> b)
Measures the similarity between lists a and b.
|
float compare(List<T> a, List<T> b)
compare
in interface Metric<List<T>>
a
- list a to compareb
- list b to compareNullPointerException
- when either a or b is nullIllegalArgumentException
- when either a or b contains null elements and this metric
does not permit lists containing null.Copyright © 2014–2018. All rights reserved.