Class OpAdaptation


  • public class OpAdaptation
    extends Object
    One powerful feature of SciJava Ops is the ability to transform individual Ops to match user requests. In this way, SciJava Ops can satisfy many different Op calls with just one implementation.

    The simplest type of transformation is termed "adaptation". Adaptation involves transforming an Op into a different functional type. A set of "engine.adapt" Ops exist to perform this transformation, taking in any Op of functional type X and returning an Op of functional type Y.

    Adaptation can be used to call a Function like a Computer, or to call an Op that operates on Doubles like an Op that operates on a List of Doubles.

    Below, we can see how this works by calling the above Field Op, supposed to work on Doubles, on an array of Doubles[]

    • Field Detail

      • fieldOp

        public final BiFunction<Double,​Double,​Double> fieldOp
        A simple Op, written as a Field, that performs a simple calculation.
        Output parameters:
        a - linear combination of {@code a} and {@code b}
        Input parameters:
        a - the first {@code Double}
        b - the second {@code Double}
        Implementation Note:
        op names="tutorial.adapt"
    • Constructor Detail

      • OpAdaptation

        public OpAdaptation()
    • Method Detail

      • main

        public static void main​(String... args)