Journal of Applied Mathematics / 2014 / Article / Alg 2

Research Article

SCondi: A Smart Context Distribution Framework Based on a Messaging Service for the Internet of Things

Algorithm 2

Example of filter chain.
FilterChain =
                 Channel.getFilterChain(CurrentWeight)
FilterChain.addFirst(new AverageFilter(10));
FilterChain.addLast(new ChangedValueFilter());
class AverageFilter
implemented Filter
       Object execute(Object c)
             sum += c;
             if (checkCount())
                 result = sum/avgCount;
                 init();
                 return nextFilter.execute(result);
                  
class ChangedValueFilter
implemented Filter
       Object execute(Object c)
             old = cur;
             cur = c;
             if (isChanged() == true)
                 return nextFilter.execute(cur);
             

We are committed to sharing findings related to COVID-19 as quickly and safely as possible. Any author submitting a COVID-19 paper should notify us at help@hindawi.com to ensure their research is fast-tracked and made available on a preprint server as soon as possible. We will be providing unlimited waivers of publication charges for accepted articles related to COVID-19. Sign up here as a reviewer to help fast-track new submissions.