|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.Frequency
Maintains a frequency distribution.
Accepts int, long or string values, converting
all to Strings and maintaining frequency counts.
Constructor Summary | |
Frequency()
Default constructor. |
|
Frequency(String name)
Construct a frequency distribution with the given name. |
Method Summary | |
void |
addValue(int v)
Adds 1 to the frequency count for v |
void |
addValue(long v)
Adds 1 to the frequency count for v. |
void |
addValue(String v)
Adds 1 to the frequency count for v |
void |
clear()
Clears the frequency table |
long |
getCount(String v)
Returns the number of values = v |
String |
getName()
Getter for property name. |
double |
getPct(String v)
Returns the percentage of values = v. |
long |
getSumFreq()
Returns the sum of all frequencies |
void |
setName(String name)
Setter for property name. |
String |
toString()
Return a string representation of describing this frequency distribution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Frequency()
public Frequency(String name)
name
- the name for the new distribution.Method Detail |
public String toString()
public void addValue(String v)
v
- the value to add.public void addValue(int v)
v
- the value to add.public void addValue(long v)
v
- the value to add.public long getCount(String v)
v
- the value to lookup.
public long getSumFreq()
public double getPct(String v)
v
- the value to lookup.
public void clear()
public String getName()
public void setName(String name)
name
- New value of property name.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |