|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
AnalysisListener | Classes that want to be notified by an Analyzer object of
the status of the analysis should implement this interface. |
Analyzer | This is the interface every Analyzer class has to implement. |
Class Summary | |
AbstractAnalyzer | Convenience class that implements the Analyzer interface. |
AnalysisEvent | The event type sent by Analyzer objects to AnalysisListener
objects. |
Exception Summary | |
AnalysisException | The class to report analysis-specific errors. |
The LMS Reporter API package provides a simple API for creating your own analysis classes
to be hosted by the LMS Reporter application.
There are two ways to create a new analyzer:
Analyzer
interface.
AbstractAnalyzer
class.
Analyzer
interface, you'll usually want to extend the
AbstractAnalyzer
class instead. The abstract
class implements all interface methods exccept for the
run
method, which is where
your analysis code should go. A minimal implementation (which just counts up to 25) might look
something like this:
import ca.macewan.lmsreporter.api.*; public class DummyAnalyzer extends AbstractAnalyzer { public DummyAnalyzer() { // This description will be used to display the analysis // in the application's analysis selection list. setDescription("Dummy Analyzer"); } public void run() { int i; for (i = 0; i < 25; i++) { updateProgress(i / 25.0); // The sleep is just to make sure the UI has time to update. // This is not necessary for a real implementation. try { Thread.currentThread().sleep(400); } catch (InterruptedException ie) { } } // Let the application know the analysis is done. finishAnalysis("Nothing was done, really"); } }For more information, check the documentation of the
AbstractAnalyzer
class.
Analyzer
(which can also be achieved by
extending AbstractAnalyzer
).
Analyzer
implementation in a single
JAR file.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |