Class LabelledWithConfidence<T>
Object
org.anchoranalysis.image.inference.segment.LabelledWithConfidence<T>
- Type Parameters:
T- element to be associated with a confidence score.
- All Implemented Interfaces:
Comparable<LabelledWithConfidence<T>>
public class LabelledWithConfidence<T> extends Object implements Comparable<LabelledWithConfidence<T>>
Like
WithConfidence but additionally adds a label.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description LabelledWithConfidence(String label, WithConfidence<T> withConfidence)LabelledWithConfidence(T element, double confidence, String label)Create for given element, confidence and label. -
Method Summary
Modifier and Type Method Description protected booleancanEqual(Object other)intcompareTo(LabelledWithConfidence<T> other)booleanequals(Object o)doublegetConfidence()The confidence associated withelement.TgetElement()The underlying element with whom a confidence and label is associated.StringgetLabel()The label associated with the element.WithConfidence<T>getWithConfidence()The element with associated confidence.inthashCode()<S> LabelledWithConfidence<S>map(Function<T,S> transform)Maps the existing object to another object, while retaining an identical confidence score.StringtoString()
-
Constructor Details
-
LabelledWithConfidence
Create for given element, confidence and label.- Parameters:
element- the underlying element with whom a confidence and label is associated.confidence- the confidence associated withelement.label- the label associated with the element.
-
LabelledWithConfidence
-
-
Method Details
-
map
Maps the existing object to another object, while retaining an identical confidence score.- Type Parameters:
S- type to map to- Parameters:
transform- converts the existing element into the new type- Returns:
- a newly created
WithConfidenceobject containing the transformed element but preserving the confidence.
-
getElement
The underlying element with whom a confidence and label is associated.- Returns:
- the element.
-
getConfidence
public double getConfidence()The confidence associated withelement.- Returns:
- the confidence.
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getLabel
The label associated with the element. -
getWithConfidence
The element with associated confidence.
-