org.apache.mahout.cf.taste.impl.common
Class FixedRunningAverage
java.lang.Object
org.apache.mahout.cf.taste.impl.common.FixedRunningAverage
- All Implemented Interfaces:
- java.io.Serializable, RunningAverage
- Direct Known Subclasses:
- FixedRunningAverageAndStdDev
public class FixedRunningAverage
- extends java.lang.Object
- implements RunningAverage, java.io.Serializable
A simple class that represents a fixed value of an average and count. This is useful
when an API needs to return RunningAverage
but is not in a position to accept
updates to it.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FixedRunningAverage
public FixedRunningAverage(double average,
int count)
addDatum
public void addDatum(double datum)
- Specified by:
addDatum
in interface RunningAverage
- Parameters:
datum
- new item to add to the running average
- Throws:
java.lang.UnsupportedOperationException
removeDatum
public void removeDatum(double datum)
- Specified by:
removeDatum
in interface RunningAverage
- Parameters:
datum
- item to remove to the running average
- Throws:
java.lang.UnsupportedOperationException
changeDatum
public void changeDatum(double delta)
- Specified by:
changeDatum
in interface RunningAverage
- Parameters:
delta
- amount by which to change a datum in the running average
- Throws:
java.lang.UnsupportedOperationException
getCount
public int getCount()
- Specified by:
getCount
in interface RunningAverage
getAverage
public double getAverage()
- Specified by:
getAverage
in interface RunningAverage
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.