com.sun.labs.minion
Class FieldValue

java.lang.Object
  extended by com.sun.labs.minion.FieldValue
All Implemented Interfaces:
java.lang.Comparable<FieldValue>

public class FieldValue
extends java.lang.Object
implements java.lang.Comparable<FieldValue>

A class containing a single field value and an associated score. Such values are returned when looking for saved string field values similar to a given value.

See Also:
SearchEngine.getMatching(java.lang.String, java.lang.String)

Constructor Summary
FieldValue(java.lang.String value, float score)
          Creates a field value
 
Method Summary
 int compareTo(FieldValue o)
          Compares one field value to another.
 float getScore()
          Gets the score
 java.lang.String getValue()
          Gets the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldValue

public FieldValue(java.lang.String value,
                  float score)
Creates a field value

Parameters:
value - the field value
score - the score associated with this value
Method Detail

getValue

public java.lang.String getValue()
Gets the value.

Returns:
the field value

getScore

public float getScore()
Gets the score

Returns:
the score

compareTo

public int compareTo(FieldValue o)
Compares one field value to another.

Specified by:
compareTo in interface java.lang.Comparable<FieldValue>
Parameters:
o - the other field value to compare
Returns:
a value less than zero, zero, or greater than zero depending on whether this field value is, respectively, smaller than, equal to, or greater than the other value.