Package pal.util

Class AlgorithmCallback.Utils

  • Enclosing interface:
    AlgorithmCallback

    public static final class AlgorithmCallback.Utils
    extends java.lang.Object
    A Utility class that provides some simple implementations of AlgorithmCallback that can be used for manipulating callback results
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • getNullCallback

        public static final AlgorithmCallback getNullCallback()
        Returns:
        an AlgorithmCallback object that never says it is time to stop, and ignores all status/progress calls
      • getPrintWriterCallback

        public static final AlgorithmCallback getPrintWriterCallback​(java.io.PrintWriter pw)
        Construct an algorithm callback that redirects status reports to a print writer
        Parameters:
        pw - A print writer object to direct status reports to
        Returns:
        An algorithm callback
      • getSystemOutCallback

        public static final AlgorithmCallback getSystemOutCallback()
      • getSubCallback

        public static final AlgorithmCallback getSubCallback​(AlgorithmCallback parent,
                                                             java.lang.String id,
                                                             double minProgress,
                                                             double maxProgress)
        Returns:
        an AlgorithmCallback object that is tied to the parent callback object such that setting the progress on the sub callback is translated to updating the progress on the parent callback but adjust to be between minProgress and maxProgress. Also any calls to updateStatus are altered to include a prefix.