forked from I2P_Developers/i2p.i2p
Add javadocs to getters
Make setters package-private Small noop tweak to the computeAverages
This commit is contained in:
@@ -434,7 +434,7 @@ public class Rate {
|
||||
out.setTotalEventCount(total);
|
||||
|
||||
if (total <= 0) {
|
||||
final double avg = useLifetime ? getAvgOrLifetimeAvg() : getAverageValue();
|
||||
final double avg = useLifetime ? getLifetimeAverageValue() : getAverageValue();
|
||||
out.setAverage(avg);
|
||||
} else {
|
||||
|
||||
|
@@ -4,6 +4,7 @@ package net.i2p.stat;
|
||||
* Storage space for computations of various averages.
|
||||
*
|
||||
* @author zab
|
||||
* @since 0.9.4
|
||||
*/
|
||||
public class RateAverages {
|
||||
|
||||
@@ -16,6 +17,7 @@ public class RateAverages {
|
||||
};
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return thread-local temp instance.
|
||||
*/
|
||||
public static RateAverages getTemp() {
|
||||
@@ -33,43 +35,67 @@ public class RateAverages {
|
||||
totalValues = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return one of several things:
|
||||
* if there are any events (current or last) => weighted average
|
||||
* otherwise if the useLifetime parameter to Rate.computeAverages was:
|
||||
* true => the lifetime average value
|
||||
* false => the current average value
|
||||
*/
|
||||
public double getAverage() {
|
||||
return average;
|
||||
}
|
||||
|
||||
public void setAverage(double average) {
|
||||
void setAverage(double average) {
|
||||
this.average = average;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return the current average == current value / current event count
|
||||
*/
|
||||
public double getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public void setCurrent(double current) {
|
||||
void setCurrent(double current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return the last average == last value / last event count
|
||||
*/
|
||||
public double getLast() {
|
||||
return last;
|
||||
}
|
||||
|
||||
public void setLast(double last) {
|
||||
void setLast(double last) {
|
||||
this.last = last;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return the total event count == current + last event counts
|
||||
*/
|
||||
public long getTotalEventCount() {
|
||||
return totalEventCount;
|
||||
}
|
||||
|
||||
public void setTotalEventCount(long totalEventCount) {
|
||||
void setTotalEventCount(long totalEventCount) {
|
||||
this.totalEventCount = totalEventCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.4
|
||||
* @return the total values == current + last values
|
||||
*/
|
||||
public double getTotalValues() {
|
||||
return totalValues;
|
||||
}
|
||||
|
||||
public void setTotalValues(double totalValues) {
|
||||
void setTotalValues(double totalValues) {
|
||||
this.totalValues = totalValues;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user