com.drismo.model
Class Quality

java.lang.Object
  extended by com.drismo.model.Quality

public class Quality
extends java.lang.Object

A static class to model quality. Use this class to get a color to represent the current quality based of a given score, and find out if a score is good/bad/ugly. This class holds all the Quality constants.


Field Summary
static int BAD_COLOR
           
static int EXCELLENT_COLOR
           
static int EXCELLENT_SCORE
           
static int GOOD_COLOR
           
static int GOOD_SCORE
           
static int MAX_SCORE
           
static int MIN_SCORE
           
static int OK_SCORE
           
static int UGLY_COLOR
           
 
Constructor Summary
private Quality()
          This class is not instantiated!
 
Method Summary
static int getColorFromScore(int score)
           
static int getDynamicColorFromScore(int score)
          Used to get a color from the score.
static int getQualityStringId(int score)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SCORE

public static final int MAX_SCORE
See Also:
Constant Field Values

EXCELLENT_SCORE

public static final int EXCELLENT_SCORE
See Also:
Constant Field Values

GOOD_SCORE

public static final int GOOD_SCORE
See Also:
Constant Field Values

OK_SCORE

public static final int OK_SCORE
See Also:
Constant Field Values

MIN_SCORE

public static final int MIN_SCORE
See Also:
Constant Field Values

EXCELLENT_COLOR

public static final int EXCELLENT_COLOR

GOOD_COLOR

public static final int GOOD_COLOR

BAD_COLOR

public static final int BAD_COLOR
See Also:
Constant Field Values

UGLY_COLOR

public static final int UGLY_COLOR
See Also:
Constant Field Values
Constructor Detail

Quality

private Quality()
This class is not instantiated!

Method Detail

getColorFromScore

public static int getColorFromScore(int score)

getDynamicColorFromScore

public static int getDynamicColorFromScore(int score)
Used to get a color from the score. The color changes fades from red -> yellow -> green -> blue

Parameters:
score - The score to get the color from
Returns:
Returns the color
See Also:
PrimitiveMonitor

getQualityStringId

public static int getQualityStringId(int score)