Class Meta

  • All Implemented Interfaces:

    
    public final class Meta
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T boundSpreading(Boolean region, Function1<Unit, T> f, T null) Constrain the spreading of f only across a region.
      final static Unit findSources(Object source)
      final static Unit findSourcesWithId(Object source, Object id, Object d, Object k)
      final static <T extends Any, U extends Any> <Error class: unknown class> ,kotlin.jvm.functions.Function1,U)>multiInstance(<Error class: unknown class> sources, Function1<T, U> f, U null) Run an instance of a function for every source id.
      final static <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.
      final static <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.
      final static <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.
      final static <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.
      final static <T extends Any> T publishSubscribe(Boolean publisher, Boolean subscriber, T information, T null) Publish/Subscribe pattern.
      final static <T extends Any> T publishSubscribeWithPotential(Number potential, Boolean subscriber, T information, T null) Publish/Subscribe pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • boundSpreading

         final static <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
        Returns:

        apply f inside the region, null outside

      • multiInstance

         final static <T extends Any, U extends Any> <Error class: unknown class> ,kotlin.jvm.functions.Function1,U)>multiInstance(<Error class: unknown class> sources, Function1<T, U> f, U null)

        Run an instance of a function for every source id.

        Parameters:
        sources - sources in the system
        f - function to be applied for every source
        null - default value
        Returns:

        list of results coming from the executed instances

      • multiRegion

         final static <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
        Returns:

        apply f or default

      • preProcessAndApply

         final static <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
        Returns:

        f(pre(input))

      • processAndApply

         final static <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
        Returns:

        post(f(pre(input)))

      • postProcessAndApply

         final static <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
        Returns:

        post(f(input))

      • publishSubscribe

         final static <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
        Returns:

        information if the device is a publisher, a subscriber or is in the shortest path between them. null otherwise

      • publishSubscribeWithPotential

         final static <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
        Returns:

        information if the device is a publisher, a subscriber or is in the shortest path between them. null otherwise