mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-04 11:38:54 +01:00
66 lines
1.8 KiB
Java
66 lines
1.8 KiB
Java
package com.amazon.bluefront.api.common;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes20.dex */
|
|
public class Hypothesis implements Comparable<Hypothesis> {
|
|
private int mConfidence;
|
|
private String mUtterance;
|
|
|
|
@Override // java.lang.Comparable
|
|
public int compareTo(Hypothesis hypothesis) {
|
|
if (hypothesis == null) {
|
|
return -1;
|
|
}
|
|
if (hypothesis == this) {
|
|
return 0;
|
|
}
|
|
if (getConfidence() < hypothesis.getConfidence()) {
|
|
return -1;
|
|
}
|
|
if (getConfidence() > hypothesis.getConfidence()) {
|
|
return 1;
|
|
}
|
|
String utterance = getUtterance();
|
|
String utterance2 = hypothesis.getUtterance();
|
|
if (utterance != utterance2) {
|
|
if (utterance == null) {
|
|
return -1;
|
|
}
|
|
if (utterance2 == null) {
|
|
return 1;
|
|
}
|
|
int compareTo = utterance.compareTo(utterance2);
|
|
if (compareTo != 0) {
|
|
return compareTo;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
return (obj instanceof Hypothesis) && compareTo((Hypothesis) obj) == 0;
|
|
}
|
|
|
|
public int getConfidence() {
|
|
return this.mConfidence;
|
|
}
|
|
|
|
public String getUtterance() {
|
|
return this.mUtterance;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return getConfidence() + 1 + (getUtterance() == null ? 0 : getUtterance().hashCode());
|
|
}
|
|
|
|
public void setConfidence(int i) {
|
|
this.mConfidence = i;
|
|
}
|
|
|
|
public void setUtterance(String str) {
|
|
this.mUtterance = str;
|
|
}
|
|
}
|