org.javanetworkanalyzer.progress
Interface ProgressMonitor

All Known Implementing Classes:
DefaultProgressMonitor, NullProgressMonitor

public interface ProgressMonitor

Keeps track of the progress of a calculation.

Author:
adam

Method Summary
 void endTask()
          Ends the currently running task.
 long getEnd()
          Gets the end value of the current task.
 int getPercentageComplete()
          Returns the percentage complete.
 boolean isCancelled()
          Returns true if the process is canceled and should end as quickly as possible.
 void setProgress(long count)
          Sets the progress and returns the percentage complete.
 void setProgress(long count, long startTime)
          Sets the progress, keeping track of the start time, and returns the percentage complete.
 void startTask(String taskName, long end)
          Starts a new task with the given name and end time.
 

Method Detail

startTask

void startTask(String taskName,
               long end)
Starts a new task with the given name and end time.

Parameters:
taskName - The task name.
end - The end time.

endTask

void endTask()
Ends the currently running task.


isCancelled

boolean isCancelled()
Returns true if the process is canceled and should end as quickly as possible.

Returns:

setProgress

void setProgress(long count)
Sets the progress and returns the percentage complete.

Parameters:
count - The count.

getPercentageComplete

int getPercentageComplete()
Returns the percentage complete.


getEnd

long getEnd()
Gets the end value of the current task.

Returns:
The end value of the current task.

setProgress

void setProgress(long count,
                 long startTime)
Sets the progress, keeping track of the start time, and returns the percentage complete.

Parameters:
count - A counter to keep track of which iteration in a loop.
startTime - The System time in milliseconds when this task was started.


Copyright © 2014. All Rights Reserved.