Package pal.util
Class AlgorithmCallback.Utils
java.lang.Object
pal.util.AlgorithmCallback.Utils
- Enclosing interface:
AlgorithmCallback
A Utility class that provides some simple implementations of AlgorithmCallback
that can be used for manipulating callback results
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final AlgorithmCallback
static final AlgorithmCallback
Construct an algorithm callback that redirects status reports to a print writerstatic final AlgorithmCallback
getSubCallback
(AlgorithmCallback parent, String id, double minProgress, double maxProgress) static final AlgorithmCallback
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getNullCallback
- Returns:
- an AlgorithmCallback object that never says it is time to stop, and ignores all status/progress calls
-
getPrintWriterCallback
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
-
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.
-