org.apache.mahout.cf.taste.impl.common
Class InvertedRunningAverage

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.common.InvertedRunningAverage
All Implemented Interfaces:
RunningAverage

public final class InvertedRunningAverage
extends Object
implements RunningAverage


Constructor Summary
InvertedRunningAverage(RunningAverage delegate)
           
 
Method Summary
 void addDatum(double datum)
           
 void changeDatum(double delta)
           
 double getAverage()
           
 int getCount()
           
 RunningAverage inverse()
           
 void removeDatum(double datum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvertedRunningAverage

public InvertedRunningAverage(RunningAverage delegate)
Method Detail

addDatum

public void addDatum(double datum)
Specified by:
addDatum in interface RunningAverage
Parameters:
datum - new item to add to the running average

removeDatum

public void removeDatum(double datum)
Specified by:
removeDatum in interface RunningAverage
Parameters:
datum - item to remove to the running average

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

getCount

public int getCount()
Specified by:
getCount in interface RunningAverage

getAverage

public double getAverage()
Specified by:
getAverage in interface RunningAverage

inverse

public RunningAverage inverse()
Specified by:
inverse in interface RunningAverage
Returns:
a (possibly immutable) object whose average is the negative of this object's


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.