Package pal.util
Class AlgorithmCallback.Utils
- java.lang.Object
-
- pal.util.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 Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AlgorithmCallback
getNullCallback()
static AlgorithmCallback
getPrintWriterCallback(java.io.PrintWriter pw)
Construct an algorithm callback that redirects status reports to a print writerstatic AlgorithmCallback
getSubCallback(AlgorithmCallback parent, java.lang.String id, double minProgress, double maxProgress)
static AlgorithmCallback
getSystemOutCallback()
-
-
-
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.
-
-