T
- element to be associated with a confidence scorepublic class WithConfidence<T> extends Object implements Comparable<WithConfidence<T>>
A natural ordering exists, highest confidences ahead of lower confidences.
Constructor and Description |
---|
WithConfidence(T element,
double confidence) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
int |
compareTo(WithConfidence<T> other) |
boolean |
equals(Object o) |
double |
getConfidence()
The confidence associated with
element . |
T |
getElement()
The underlying element with whom a confidence is associated.
|
int |
hashCode() |
<S> WithConfidence<S> |
map(java.util.function.Function<T,S> transform)
Maps the existing object to another object, while retaining an identical confidence score.
|
String |
toString() |
public WithConfidence(T element, double confidence)
public <S> WithConfidence<S> map(java.util.function.Function<T,S> transform)
S
- type to map totransform
- converts the existing element into the new typeWithConfidence
object containing the transformed element but
preserving the confidence.public int compareTo(WithConfidence<T> other)
compareTo
in interface Comparable<WithConfidence<T>>
protected boolean canEqual(Object other)
public T getElement()
public double getConfidence()
element
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.