LBJ2.classify
Class ScoreSet

java.lang.Object
  extended by LBJ2.classify.ScoreSet
All Implemented Interfaces:
java.lang.Cloneable

public class ScoreSet
extends java.lang.Object
implements java.lang.Cloneable

A score set is simply a set of Scores.

See Also:
Score

Field Summary
private  java.util.Map set
          The scores in this set, indexed by the discrete classification.
 
Constructor Summary
ScoreSet()
          Default constructor.
ScoreSet(Score[] scores)
          The elements of the array are added to the set.
ScoreSet(java.lang.String[] values, double[] scores)
          The elements of the two argument arrays are assumed to be pair-wise associated with each other.
 
Method Summary
 java.lang.Object clone()
          Produces a deep copy of this object.
 double get(java.lang.String v)
          Returns the double precision score for a particular classification value.
 Score getScore(java.lang.String v)
          Retrieves the Score object associated with the given classification value.
 java.lang.String highScoreValue()
          Retrieves the value with the highest score in this set.
 void put(java.lang.String v, double s)
          Sets the score for a particular classification value.
 int size()
          Returns the number of scores in this set.
 Score[] toArray()
          Returns an array view of the Scores contained in this set.
 java.lang.String toString()
          The string representation of a ScoreSet is the concatenation of the string representations of each Score in the set sorted by value, separated by commas, and surrounded by curly braces.
 java.util.Set values()
          Retrieves the set of values that have scores associated with them in this score set.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

set

private java.util.Map set
The scores in this set, indexed by the discrete classification.

Constructor Detail

ScoreSet

public ScoreSet()
Default constructor.


ScoreSet

public ScoreSet(java.lang.String[] values,
                double[] scores)
The elements of the two argument arrays are assumed to be pair-wise associated with each other.

Parameters:
values - The classification values being scored.
scores - The scores of the classification values.

ScoreSet

public ScoreSet(Score[] scores)
The elements of the array are added to the set.

Parameters:
scores - The scores to add to the set.
Method Detail

size

public int size()
Returns the number of scores in this set.


put

public void put(java.lang.String v,
                double s)
Sets the score for a particular classification value.

Parameters:
v - The classification value.
s - The score.

values

public java.util.Set values()
Retrieves the set of values that have scores associated with them in this score set.

Returns:
A set of Strings.

get

public double get(java.lang.String v)
Returns the double precision score for a particular classification value.

Parameters:
v - The classification value.
Returns:
The associated score.

getScore

public Score getScore(java.lang.String v)
Retrieves the Score object associated with the given classification value.

Parameters:
v - The classification value.
Returns:
The associated Score object.

highScoreValue

public java.lang.String highScoreValue()
Retrieves the value with the highest score in this set.


toArray

public Score[] toArray()
Returns an array view of the Scores contained in this set.

Returns:
An array of Scores.

toString

public java.lang.String toString()
The string representation of a ScoreSet is the concatenation of the string representations of each Score in the set sorted by value, separated by commas, and surrounded by curly braces.

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

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.