RecognitionCandidate
Stay organized with collections
Save and categorize content based on your preferences.
Individual recognition candidate.
A recognizer usually provides several recognition alternatives. This object represents one
such alternative.
See RecognitionResult
for more details.
Protected Constructor Summary
Public Method Summary
boolean |
equals( Object other)
Indicates whether some other object is "equal to" this one.
|
Float
|
getScore()
Returns this candidate's score.
|
String
|
getText()
Returns the textual representation of the recognition.
|
int |
hashCode()
Returns a hash code value for the object.
|
String
|
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Protected Constructors
protected RecognitionCandidate ()
Public Methods
public boolean equals (Object other)
Indicates whether some other object is "equal to" this one.
public Float getScore ()
Returns this candidate's score.
Values may be positive or negative. More likely candidates get lower values. This
value is populated only for models that support scores. Otherwise a null
value is returned.
Scores are meant to be used to reject candidates whose score is above a threshold. A
particular threshold value for a given application will stay valid after a model
update.
public String getText ()
Returns the textual representation of the recognition.
public int hashCode ()
Returns a hash code value for the object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[],[],null,["# RecognitionCandidate\n\npublic class **RecognitionCandidate** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nIndividual recognition candidate.\n\nA recognizer usually provides several recognition alternatives. This object represents one\nsuch alternative.\n\nSee [RecognitionResult](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionResult)\nfor more details. \n\n### Protected Constructor Summary\n\n|---|------------------------------------------------------------------------------------------------------------------------------------|\n| | [RecognitionCandidate](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#RecognitionCandidate())() |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) Indicates whether some other object is \"equal to\" this one. |\n| [Float](//developer.android.com/reference/java/lang/Float.html) | [getScore](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#getScore())() Returns this candidate's score. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getText](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#getText())() Returns the textual representation of the recognition. |\n| int | [hashCode](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#hashCode())() Returns a hash code value for the object. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/mlkit/vision/digitalink/common/RecognitionCandidate#toString())() |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nProtected Constructors\n----------------------\n\n#### protected **RecognitionCandidate** ()\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\nIndicates whether some other object is \"equal to\" this one. \n\n#### public [Float](//developer.android.com/reference/java/lang/Float.html) **getScore** ()\n\nReturns this candidate's score.\n\nValues may be positive or negative. More likely candidates get lower values. This\nvalue is populated only for models that support scores. Otherwise a `null`\nvalue is returned.\n\nScores are meant to be used to reject candidates whose score is above a threshold. A\nparticular threshold value for a given application will stay valid after a model\nupdate. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getText** ()\n\nReturns the textual representation of the recognition. \n\n#### public int **hashCode** ()\n\nReturns a hash code value for the object. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()"]]