org.pfsw.bif.callback
Interface IProgressListener


public interface IProgressListener

A generic interface for listeners of any long-running actions that need to be observable and stoppable.


Field Summary
static boolean CONTINUE
          The value returned by a listener that signals to continue processing.
static boolean STOP
          The value returned by a listener that signals to stop processing.
static long UNDEFINED_SIZE
          This value specifies that the size is undefined or unknown.
 
Method Summary
 boolean processed(long totalSize, long processedSize)
          Will be called for each arbitrary chunk of work that has been processed.
 

Field Detail

UNDEFINED_SIZE

static final long UNDEFINED_SIZE
This value specifies that the size is undefined or unknown.

See Also:
Constant Field Values

CONTINUE

static final boolean CONTINUE
The value returned by a listener that signals to continue processing.

See Also:
Constant Field Values

STOP

static final boolean STOP
The value returned by a listener that signals to stop processing.

See Also:
Constant Field Values
Method Detail

processed

boolean processed(long totalSize,
                  long processedSize)
Will be called for each arbitrary chunk of work that has been processed.

Parameters:
totalSize - The total size to be processed for complete execution. If the total size is unknown the UNDEFINED_SIZE value must be passed in.
processedSize - The size that has already been processed.
Returns:
true (CONTINUE) if processing should continue, false (STOP) if processing should stop now.