de.aitools.dm.clusterlabeling.validation.internal
Class RatedPhrase

java.lang.Object
  extended by de.aitools.dm.clusterlabeling.validation.internal.RatedPhrase

public class RatedPhrase
extends java.lang.Object

String-Representation (toString()): ["label" : rating]

rating = 2^relevance - 1

Version:
$Id: RatedPhrase.java,v 1.1 2011/02/18 16:08:24 hoppe Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Field Summary
static double BAD
           
static double EXCELLENT
           
static double FAIR
           
static double GOOD
           
static double PERFECT
           
 
Constructor Summary
RatedPhrase(java.lang.String label, double relevance)
          A RatedPhrase consist of two values: Label
The phrase itself Rating
A value for how good the label is: The higher the better.
Calculated as 2^relevance - 1
 
Method Summary
 RatedPhrase copy()
           
 java.lang.String getLabel()
           
 double getRating()
           
 void setLabel(java.lang.String label)
           
 void setRating(int rating)
           
 void setRelevance(double relevance)
          Same as setRating(X) with X being 2^relevance - 1
static RatedPhrase[] sort(RatedPhrase[] input, javax.swing.SortOrder order)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAD

public static final double BAD
See Also:
Constant Field Values

FAIR

public static final double FAIR
See Also:
Constant Field Values

GOOD

public static final double GOOD
See Also:
Constant Field Values

EXCELLENT

public static final double EXCELLENT
See Also:
Constant Field Values

PERFECT

public static final double PERFECT
See Also:
Constant Field Values
Constructor Detail

RatedPhrase

public RatedPhrase(java.lang.String label,
                   double relevance)
A RatedPhrase consist of two values:
  1. Label
    The phrase itself
  2. Rating
    A value for how good the label is: The higher the better.
    Calculated as 2^relevance - 1

Parameters:
label -
relevance - direct input or use one of the static aliases of this class (for example RatedPhrase.GOOD)
Method Detail

setLabel

public void setLabel(java.lang.String label)

setRating

public void setRating(int rating)

setRelevance

public void setRelevance(double relevance)
Same as setRating(X) with X being 2^relevance - 1

Parameters:
relevance -

getLabel

public java.lang.String getLabel()

getRating

public double getRating()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

copy

public RatedPhrase copy()

sort

public static RatedPhrase[] sort(RatedPhrase[] input,
                                 javax.swing.SortOrder order)
Parameters:
input - will not be changed - a copy is created before sorting
Returns: