LBJ2.classify
Class Score

java.lang.Object
  extended by LBJ2.classify.Score
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class Score
extends java.lang.Object
implements java.lang.Comparable, java.lang.Cloneable

A score is a number produced by a learner that indicates the degree to which a particular discrete classification is appropriate for a given object. The scores for all possible discrete classifications given an object need not be positive or sum to one. A Score object simply contains a score and the associated discrete classification.


Field Summary
 double score
          The score.
 java.lang.String value
          The discrete classification associated with this score.
 
Constructor Summary
Score(java.lang.String v, double s)
          Initializes both member variables.
 
Method Summary
 java.lang.Object clone()
          Produces a deep copy of this object.
 int compareTo(java.lang.Object o)
          This method is implemented so that a collection of Scores will be sorted first by value and then by score.
 java.lang.String toString()
          The string representation of a Score is the value followed by the score separated by a colon.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public java.lang.String value
The discrete classification associated with this score.


score

public double score
The score.

Constructor Detail

Score

public Score(java.lang.String v,
             double s)
Initializes both member variables.

Parameters:
v - The discrete classification.
s - The score.
Method Detail

compareTo

public int compareTo(java.lang.Object o)
This method is implemented so that a collection of Scores will be sorted first by value and then by score.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to compare against.
Returns:
A negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified object respectively.

toString

public java.lang.String toString()
The string representation of a Score is the value followed by the score separated by a colon.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of a Score.

clone

public java.lang.Object clone()
Produces a deep copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
A deep copy of this object.