org.jaitools.jiffle.runtime
Class AbstractProgressListener

java.lang.Object
  extended by org.jaitools.jiffle.runtime.AbstractProgressListener
All Implemented Interfaces:
JiffleProgressListener
Direct Known Subclasses:
NullProgressListener

public abstract class AbstractProgressListener
extends java.lang.Object
implements JiffleProgressListener

A simple progress listener base. Extend this and provide your own start(), update(long numPixelsDone) and finish() methods.

Since:
0.1
Version:
$Id: AbstractProgressListener.java 1653 2011-06-16 10:23:02Z michael.bedward $
Author:
Michael Bedward

Field Summary
protected  long taskSize
          The total number of pixels to process.
protected  long updateInterval
          The number of pixels processed between each call to the listener.
protected  java.lang.Double updateProp
          The proportion of pixels processed between each call to the listener.
 
Constructor Summary
AbstractProgressListener()
          Creates a new instance with an update interval of 1.
 
Method Summary
 long getUpdateInterval()
          Gets the update interval.
 void setTaskSize(long numPixels)
          Called by the runtime object at the start of processing to set this listener's task size field.
 void setUpdateInterval(double propPixels)
          Sets the update interval expressed a proportion of the total number of pixels.
 void setUpdateInterval(long numPixels)
          Sets the update interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaitools.jiffle.runtime.JiffleProgressListener
finish, start, update
 

Field Detail

updateInterval

protected long updateInterval
The number of pixels processed between each call to the listener.


updateProp

protected java.lang.Double updateProp
The proportion of pixels processed between each call to the listener.


taskSize

protected long taskSize
The total number of pixels to process.

Constructor Detail

AbstractProgressListener

public AbstractProgressListener()
Creates a new instance with an update interval of 1.

Method Detail

setUpdateInterval

public void setUpdateInterval(long numPixels)
Sets the update interval.

Specified by:
setUpdateInterval in interface JiffleProgressListener
Parameters:
numPixels - number of pixels processed between each call to the listener

setUpdateInterval

public void setUpdateInterval(double propPixels)
Sets the update interval expressed a proportion of the total number of pixels.

Specified by:
setUpdateInterval in interface JiffleProgressListener
Parameters:
propPixels - proportion of pixels processed between each call to the listener

getUpdateInterval

public long getUpdateInterval()
Gets the update interval.

Specified by:
getUpdateInterval in interface JiffleProgressListener
Returns:
interval as number of pixels

setTaskSize

public void setTaskSize(long numPixels)
Called by the runtime object at the start of processing to set this listener's task size field.

Specified by:
setTaskSize in interface JiffleProgressListener
Parameters:
numPixels - task size as number of pixels to process


Copyright © 2011. All Rights Reserved.