tnt.metrics
Interface TnMetric

All Known Implementing Classes:
TnKSPC, TnWPM

public interface TnMetric

This interface defines the minimum elements for any class that calculates a metric in the TnToolkit. That is, it must define a method to process input as part of is calculation. It must also allow other objects to monitor its progress, and if necessary cancel it.

Version:
1.0 - 02/2006
Author:
Steven J. Castellucci

Method Summary
 void cancel()
          Signals calculation of this metric to stop.
 boolean cancelled()
          Returns whether or not cancel() was called on this metric.
 float getProgress()
          Returns a float in the range [0..1], representing the progress of the process() method.
 void process()
          Performs the required calculations and actions to determine the value and result of this metric.
 

Method Detail

process

void process()
Performs the required calculations and actions to determine the value and result of this metric.


cancel

void cancel()
Signals calculation of this metric to stop.


cancelled

boolean cancelled()
Returns whether or not cancel() was called on this metric.

Returns:
true iff cancel() was called on this metric object.
See Also:
cancel()

getProgress

float getProgress()
Returns a float in the range [0..1], representing the progress of the process() method.

Returns:
a float in the range [0..1], representing the progress of the process() method.


Copyright © 2006 Steven Castellucci and Scott MacKenzie. All Rights Reserved.