public class Filters
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T,V> TStream<T> |
deadband(TStream<T> stream,
Function<T,V> value,
Predicate<V> inBand,
long maximumSuppression,
java.util.concurrent.TimeUnit unit)
Deadband filter with maximum suppression time.
|
static <T,V> TStream<T> |
deadband(TStream<T> stream,
Function<T,V> value,
Predicate<V> inBand)
Deadband filter.
|
public static <T,V> TStream<T> deadband(TStream<T> stream, Function<T,V> value, Predicate<V> inBand, long maximumSuppression, java.util.concurrent.TimeUnit unit)
A tuple t is passed through the deadband filter if:
inBand.test(value.apply(t)) is false, that is the tuple's value is outside of the deadband
inBand.test(value.apply(t)) is true AND the last tuple's value was outside of the deadband.
This corresponds to the first tuple's value inside the deadband after a period being outside it.
maximumSuppression seconds (in unit unit)
T - Tuple type.V - Value type for the deadband function.stream - Stream containing readings.value - Function to obtain the tuple's value passed to the deadband function.inBand - Function that defines the deadband.maximumSuppression - Maximum amount of time to suppress values that are in the deadband.unit - Unit for maximumSuppression.public static <T,V> TStream<T> deadband(TStream<T> stream, Function<T,V> value, Predicate<V> inBand)
A tuple t is passed through the deadband filter if:
inBand.test(value.apply(t)) is false, that is the value is outside of the deadband
inBand.test(value.apply(t)) is true and the last value was outside of the deadband.
This corresponds to the first value inside the deadband after a period being outside it.
Here's an example of how deadband() would pass through tuples for a sequence of
values against the shaded dead band area. Circled values are ones that are passed through
the filter to the returned stream.
T - Tuple type.V - Value type for the deadband function.stream - Stream containing readings.value - Function to obtain the value passed to the deadband function.inBand - Function that defines the deadband.Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902