Hi everyone,
Suppose I have to compute a filter condition
Integer threshold = compute threshold();
If I:
temperatureStream.filter(new FilterFunction<temperature>() {
@Override
public boolean filter(Integer temperature) throws Exception {
Integer threshold = compute threshold();
return temperature > threshold
}
would this mean I have computed threshold over and over again, for every
new element in the stream?
my threshold does not changes once it computed. I don't want to recompute
it every time for new elements? is there way I can pass it as a parameter
to the filter function?