Package pal.util

Class AlgorithmCallback.Utils

java.lang.Object
pal.util.AlgorithmCallback.Utils
Enclosing interface:
AlgorithmCallback

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

    • Utils

      public Utils()
  • Method Details

    • 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(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, 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.