Class ReportingProgress


  • public class ReportingProgress
    extends Object
    Long-running Ops can be confusing for users. By defining and then reporting progress, Ops can tell the user how far it has gotten in the computation.

    At the heart of progress reporting is the Progress class, responsible for conveying Ops' progress to users. SciJava Progress defines progress on a scale of [0, 1], where:

    • 0 defines work that has not yet started
    • 1 defines work that has been completed
    • values in between define work in progress

    Ops tell the Progress a few things:

    1. The number of "elements" in a computation, as well as "subtasks", i.e. dependent Ops
    2. When each "element" has been completed

    Note the difference between an "element" of computation, and a "subtask"

    • elementss are pieces of computation done by the Op
    • subtasks are phases of computation done by other Ops
    Users are then notified by the progress of Ops by installing Consumer<Task>s.
    Author:
    Gabriel Selzer
    • Field Detail

      • primes

        public final Function<Integer,​List<Long>> primes
        An Op that reports its progress while finding prime numbers.
        Output parameters:
        a - {@link List} of prime numbers
        Input parameters:
        numPrimes - the quantity of unique prime numbers to find
        Implementation Note:
        op names="tutorial.long.op"
    • Constructor Detail

      • ReportingProgress

        public ReportingProgress()
    • Method Detail

      • main

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