hhreco.recognition
Class RecognitionSet

java.lang.Object
  extended byhhreco.recognition.RecognitionSet

public class RecognitionSet
extends java.lang.Object

The result of a recognizer's computations: a set of mutually exclusive interpretations of a stroke or a set of strokes, expressed by Recognition objects as typed data with associated values.

See Also:
Recognition

Field Summary
static RecognitionSet NO_RECOGNITION
          A constant that represents no recognition results.
 
Constructor Summary
RecognitionSet()
          Construct an empty recognition set.
RecognitionSet(Recognition[] rs)
          Construct a recognition set that contains the given recognitions.
 
Method Summary
 void addRecognition(Recognition r)
          Add a recognition to the set by inserting it in descending order of confidence value.
 Recognition getHighestValueRecognition()
          Return the recognition object that has the highest value.
 Recognition getLowestValueRecognition()
          Return the recognition object that has the lowest value.
 int getRecognitionCount()
          Return the number of recognitions in this set.
 Recognition getRecognitionOfType(Type type)
          Return the recognition contained by this set with the given type, or null if it's not contained.
 java.util.Iterator recognitions()
          Return an iterator over the recognized types in sorted order from highest confidence to lowest.
 void removeRecognition(Recognition r)
          Remove the given recognition from the set.
 java.lang.String toString()
          Return the text representation of the recognition set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_RECOGNITION

public static final RecognitionSet NO_RECOGNITION
A constant that represents no recognition results.

Constructor Detail

RecognitionSet

public RecognitionSet()
Construct an empty recognition set.


RecognitionSet

public RecognitionSet(Recognition[] rs)
Construct a recognition set that contains the given recognitions.

Method Detail

addRecognition

public void addRecognition(Recognition r)
Add a recognition to the set by inserting it in descending order of confidence value.


getHighestValueRecognition

public Recognition getHighestValueRecognition()
Return the recognition object that has the highest value.


getLowestValueRecognition

public Recognition getLowestValueRecognition()
Return the recognition object that has the lowest value.


getRecognitionCount

public int getRecognitionCount()
Return the number of recognitions in this set.


getRecognitionOfType

public Recognition getRecognitionOfType(Type type)
Return the recognition contained by this set with the given type, or null if it's not contained.


recognitions

public java.util.Iterator recognitions()
Return an iterator over the recognized types in sorted order from highest confidence to lowest.


removeRecognition

public void removeRecognition(Recognition r)
Remove the given recognition from the set.


toString

public java.lang.String toString()
Return the text representation of the recognition set.