Package 

Class metaKt

    • Method Detail

      • boundSpreading

         final <T extends Any> T boundSpreading(Boolean region, Function1<Unit, T> f, T null)

        Constrain the spreading of f only across a region.

        Parameters:
        region - whether the function is spreaded or not
        f - function to be spreaded
        null - default value where f is not spreaded
      • multiRegion

         final <T extends Any, U extends Any> U multiRegion(T discriminant, Function1<T, Boolean> filter, Function1<Unit, U> function, U default)

        Splice devices into regions according to the discriminant and apply f.

        Parameters:
        discriminant - split regions according to this value
        filter - how to handle the discriminant value
        function - what to apply in each region
        default - default value
      • preProcessAndApply

         final <G extends Any, H extends Any, I extends Any> I preProcessAndApply(G input, Function1<G, H> pre, Function1<H, I> f)

        Feed f with pre-processed data.

        Parameters:
        input - input
        pre - how to pre-process
        f - what to do
      • processAndApply

         final <G extends Any, H extends Any, I extends Any, T extends Any> T processAndApply(G input, Function1<G, H> pre, Function1<H, I> f, Function1<I, T> post)

        Feed f with pre-processed data, and then post-process the output.

        Parameters:
        input - input
        pre - how to pre-process
        f - what to do
        post - how to post process
      • postProcessAndApply

         final <G extends Any, H extends Any, I extends Any, T extends Any> T postProcessAndApply(G input, Function1<H, I> f, Function1<I, T> post)

        Apply f, and then post-process the output.

        Parameters:
        input - input
        f - what to do
        post - how to post process
      • publishSubscribe

         final <T extends Any> T publishSubscribe(Boolean publisher, Boolean subscriber, T information, T null)

        Publish/Subscribe pattern.

        Parameters:
        publisher - who publishes
        subscriber - who is subscribing
        information - what to share
        null - what to share if you are neither a subscriber nor a publisher
      • publishSubscribeWithPotential

         final <T extends Any> T publishSubscribeWithPotential(Number potential, Boolean subscriber, T information, T null)

        Publish/Subscribe pattern.

        Parameters:
        potential - aggregation direction (publisher are devices whose potential is 0)
        subscriber - who is subscribing
        information - what to share
        null - what to share if you are neither a subscriber nor a publisher