- All Implemented Interfaces:
IFilter
This class lets you rate limit a stream of inputs
Instead of being based on the rate that update is called, the value you give it is based on
how much it should be able to change in one second.
-
Constructor Summary
Constructors
-
Method Summary
double
Get next value in Filter based on the next value given
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RateLimit
public RateLimit(Number rateLimit)
- Parameters:
rateLimit
- The amount that the value should be able to change in one second.
-
Method Details
-
get
public double get(double next)
Description copied from interface: IFilter
Get next value in Filter based on the next value given
- Specified by:
get
in interface IFilter
- Parameters:
next
- next input value in the stream
- Returns:
- the output value of the filter