|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.parlor.rating.util.Percentiler
public class Percentiler
Used to keep track of the percentile distribution of positive values (generally puzzle scores).
| Constructor Summary | |
|---|---|
Percentiler()
Creates an empty percentiler. |
|
Percentiler(byte[] data)
Creates a percentiler from its serialized representation. |
|
Percentiler(int min,
int max)
Creates a percentiler that expects values to fall within the given range. |
|
| Method Summary | |
|---|---|
void |
clearModified()
Clears this percentiler's "is modified" state. |
void |
dump(PrintWriter out)
Dumps a text representation of this percentiler to the supplied print stream. |
void |
dumpGnuPlot(PrintWriter out)
Dumps out our data in a format that can be used to generate a gnuplot. |
int[] |
getCounts()
Returns the counts for each bucket. |
int |
getMaxScore()
Returns the largest score seen by this percentiler. |
int |
getMinScore()
Returns the smallest score seen by this percentiler. |
int |
getPercentile(float value)
Returns the percent of all numbers seen that are lower than the specified value. |
long |
getRecordedCount()
Returns the total number of values ever recorded to this percentiler. |
float |
getRequiredScore(int percentile)
Returns the score necessary to attain the specified percentile. |
float[] |
getRequiredScores()
Returns the scores required to obtain a percentile rating from 0 to 99. |
boolean |
isModified()
Returns true if thsi percentiler has been modified since it was created or since the last call to clearModified(). |
void |
recomputePercentiles()
Recomputes the percentile cutoffs based on the values recorded since the last percentile computation. |
void |
recordValue(float value)
Records a value, updating the histogram but not the percentiles (a call to recomputePercentiles() is required for that and is sufficiently expensive that it shouldn't
be done every time a value is added). |
void |
recordValue(float value,
boolean logNewMax)
See recordValue(float). |
byte[] |
toBytes()
Converts this percentiler to a byte array so that it may be stored into a database. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Percentiler()
public Percentiler(int min,
int max)
public Percentiler(byte[] data)
| Method Detail |
|---|
public void recordValue(float value)
recomputePercentiles() is required for that and is sufficiently expensive that it shouldn't
be done every time a value is added).
public void recordValue(float value,
boolean logNewMax)
recordValue(float).
public long getRecordedCount()
public boolean isModified()
clearModified().
public void clearModified()
public int getPercentile(float value)
recomputePercentiles().
public float getRequiredScore(int percentile)
recomputePercentiles().
percentile - the desired percentile (from 0 to 99 inclusive).public int getMaxScore()
public int getMinScore()
public float[] getRequiredScores()
public int[] getCounts()
public void recomputePercentiles()
public byte[] toBytes()
public String toString()
toString in class Objectpublic void dumpGnuPlot(PrintWriter out)
public void dump(PrintWriter out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||