Package com.esri.core.geometry
Class ProgressTracker
- java.lang.Object
-
- com.esri.core.geometry.ProgressTracker
-
public abstract class ProgressTracker extends java.lang.Object
A callback to provide progress and cancel tracking mechanism for lengthy operation.
-
-
Constructor Summary
Constructors Constructor Description ProgressTracker()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
checkAndThrow(ProgressTracker tracker)
Checks the tracker and throws UserCancelException if tracker is not null and progress returns falseabstract boolean
progress(int step, int totalExpectedSteps)
Periodically called by a lengthy operation to check if the caller requested to cancel.
-
-
-
Method Detail
-
progress
public abstract boolean progress(int step, int totalExpectedSteps)
Periodically called by a lengthy operation to check if the caller requested to cancel.- Parameters:
step
- The current step of the operation.totalExpectedSteps
- is the number of steps the operation is expects to complete its task.- Returns:
- true, if the operation can continue. Returns False, when the operation has to terminate due to a user cancelation.
-
checkAndThrow
public static void checkAndThrow(ProgressTracker tracker)
Checks the tracker and throws UserCancelException if tracker is not null and progress returns false- Parameters:
tracker
- can be null, then the method does nothing.
-
-