2024-06-15 19:55:30 +00:00
|
|
|
|
package logging;
|
|
|
|
|
|
2024-07-02 19:13:30 +00:00
|
|
|
|
import visualisation.HybridWindow;
|
|
|
|
|
import visualisation.ParameterArea;
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This class provides the basic algorithm.
|
|
|
|
|
* Use it in assoziation with packages logging and visualization.
|
|
|
|
|
* Extend it by the members you need and overwrite LogElementList<LOG>run() which contains the specific algorithmic procedures.
|
|
|
|
|
* Therein you should fill a LogElementList and return it.
|
|
|
|
|
* Parameters for algorithm processing are read from member parameterArea that ist part of the user interface.
|
2024-07-02 19:13:30 +00:00
|
|
|
|
* @see LogElement
|
|
|
|
|
* @see LogElementList
|
|
|
|
|
* @see HybridWindow
|
|
|
|
|
* @see ParameterArea
|
|
|
|
|
* @author Bj<EFBFBD>rn Strobel<br><small>
|
2024-06-15 19:55:30 +00:00
|
|
|
|
* University of Cooperative Education Stuttgart,
|
|
|
|
|
* Campus Horb<br>
|
|
|
|
|
* Department of Information Technology<br>
|
|
|
|
|
* it2003<br></small>
|
|
|
|
|
*/
|
2024-07-02 19:13:30 +00:00
|
|
|
|
public abstract class Algorithm<PARAM extends ParameterArea,LOG extends LogElement> {
|
2024-06-15 19:55:30 +00:00
|
|
|
|
|
|
|
|
|
/**Algorithm title.*/
|
|
|
|
|
protected String title;
|
|
|
|
|
/**Algorithm parameter area from which the algorithm gets its parameters.*/
|
|
|
|
|
protected PARAM parameterArea;
|
|
|
|
|
|
|
|
|
|
/**Standard constructor.*/
|
|
|
|
|
public Algorithm() {
|
|
|
|
|
super();
|
|
|
|
|
// TODO Auto-generated constructor stub
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**Creates algorithm with specified title and parameter area.*/
|
2024-07-02 19:13:30 +00:00
|
|
|
|
public Algorithm(PARAM parameterArea, String title){
|
2024-06-15 19:55:30 +00:00
|
|
|
|
this.parameterArea=parameterArea;
|
|
|
|
|
this.title=title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runs the algorithm with parameters specified in parameterArea.
|
|
|
|
|
* Returns the LogElementList produced by the algorithm processing.
|
|
|
|
|
* To use this class you will have to overwrite this method.
|
|
|
|
|
* @return a LogElementList containing the algorithm processings single steps
|
|
|
|
|
*/
|
|
|
|
|
public abstract LogElementList<LOG>run();
|
|
|
|
|
//return new LogElementList<LOG>()
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the algorithm title.
|
|
|
|
|
* @return the algorithm title.
|
|
|
|
|
*/
|
|
|
|
|
public String getTitle(){
|
|
|
|
|
return title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the algorithm's title.
|
|
|
|
|
* @param title the algorithm's title
|
|
|
|
|
*/
|
|
|
|
|
public void setTitle(String title){
|
|
|
|
|
this.title=title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the algorithm's parameter area.
|
|
|
|
|
* @param parameterArea the algorithm's parameter area
|
|
|
|
|
*/
|
|
|
|
|
public void setParameterArea(PARAM parameterArea){
|
|
|
|
|
this.parameterArea=parameterArea;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the algorithm's parameter area.
|
|
|
|
|
* @return the algorithm's parameter area
|
|
|
|
|
*/
|
|
|
|
|
public PARAM getParameterArea(){
|
|
|
|
|
return parameterArea;
|
|
|
|
|
}
|
|
|
|
|
}
|