Package org.locationtech.jts.jump.task
Class PrintStreamTaskMonitor
- java.lang.Object
-
- org.locationtech.jts.jump.task.PrintStreamTaskMonitor
-
- All Implemented Interfaces:
TaskMonitor
public class PrintStreamTaskMonitor extends Object implements TaskMonitor
A TaskMonitor that reports its output to a PrintStream. User can control the level of output reported, as well as whether timing information is logged as well.
-
-
Constructor Summary
Constructors Constructor Description PrintStreamTaskMonitor()
PrintStreamTaskMonitor(PrintStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allowCancellationRequests()
Notifies parties that the task will accept requests for cancellation (though the task is not obligated to cancel immediately, or at all for that matter).boolean
isCancelRequested()
Checks whether a party has requested that the task be cancelled.void
report(int subtasksDone, int totalSubtasks, String subtaskDescription)
Reports the number of items processed.void
report(Exception exception)
Reports an Exception that occurred.void
report(String description)
Describes the status of the task.void
setLoggingSubtasks(boolean isLoggingSubtasks)
-
-
-
Constructor Detail
-
PrintStreamTaskMonitor
public PrintStreamTaskMonitor(PrintStream stream)
-
PrintStreamTaskMonitor
public PrintStreamTaskMonitor()
-
-
Method Detail
-
setLoggingSubtasks
public void setLoggingSubtasks(boolean isLoggingSubtasks)
-
report
public void report(String description)
Description copied from interface:TaskMonitor
Describes the status of the task.- Specified by:
report
in interfaceTaskMonitor
- Parameters:
description
- a description of the progress of the overall task
-
report
public void report(Exception exception)
Description copied from interface:TaskMonitor
Reports an Exception that occurred. The task may choose to carry on.- Specified by:
report
in interfaceTaskMonitor
- Parameters:
exception
- an Exception that occurred during the execution of the task.
-
report
public void report(int subtasksDone, int totalSubtasks, String subtaskDescription)
Description copied from interface:TaskMonitor
Reports the number of items processed.- Specified by:
report
in interfaceTaskMonitor
- Parameters:
subtasksDone
- the number of items that have been processedtotalSubtasks
- the total number of items being processed, or -1 if the total number is not knownsubtaskDescription
- a one-word description of the items, such as "features"
-
allowCancellationRequests
public void allowCancellationRequests()
Description copied from interface:TaskMonitor
Notifies parties that the task will accept requests for cancellation (though the task is not obligated to cancel immediately, or at all for that matter).- Specified by:
allowCancellationRequests
in interfaceTaskMonitor
-
isCancelRequested
public boolean isCancelRequested()
Description copied from interface:TaskMonitor
Checks whether a party has requested that the task be cancelled. However, the task is not obligated to cancel immediately (or at all).- Specified by:
isCancelRequested
in interfaceTaskMonitor
- Returns:
- whether a party has requested that the task be cancelled
-
-