de.dfg.oc.logfileanalyzer.histogram
Class AbstractHistogram

java.lang.Object
  extended by de.dfg.oc.logfileanalyzer.histogram.AbstractHistogram
Direct Known Subclasses:
SpecificityHistogram, UniversalHistogram

public abstract class AbstractHistogram
extends Object

Abstract class for histograms. Inherit from this abstract class when creating new histograms. The calculateHistogramData()-method has to provide the data displayed in the histogram.

Author:
Clemens Gersbacher, Holger Prothmann

Field Summary
(package private)  String description
          Describes this histogram.
private  int numberOfVisibleClassifiers
          Number of classifiers shown in the histogram
 
Constructor Summary
AbstractHistogram(String _description)
          Constructor.
 
Method Summary
abstract  Vector<Double> calculateHistogramData(DefaultTableModel _selectedTable)
          Abstract method.
private  JPanel createErrorPanel(String _text)
          Creates a panel for error messages.
 JPanel createHistogram(DataElement _dataElement, int _selectedTableId, double _lowerLimit, double _upperLimit)
          Returns a panel containing a histogram.
(package private)  JPanel createHistogram(Vector<Double> _histogramData, double _lowerLimit, double _upperLimit)
          Returns a panel containing a histogram.
 int getNumberOfVisibleClassifiers()
          Return the number of classifiers shown in the histogram.
 String toString()
          Returns a description for this histogram.
(package private)  boolean valueWithinLimits(double _value, double _lowerLimit, double _upperLimit)
          Tests if a given value lies within two limits.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

description

String description
Describes this histogram. The description is used for identification in the histogram selection and as histogram title.


numberOfVisibleClassifiers

private int numberOfVisibleClassifiers
Number of classifiers shown in the histogram

Constructor Detail

AbstractHistogram

public AbstractHistogram(String _description)
Constructor. Requires a description that is used for identification in the histogram selection and as histogram title.

Parameters:
_description - a description that is used for identification in the histogram selection and as histogram title
Method Detail

toString

public String toString()
Returns a description for this histogram. The description is used for identification in the histogram selection and as histogram title.

Overrides:
toString in class Object
Returns:
a description for this histogram

createHistogram

public JPanel createHistogram(DataElement _dataElement,
                              int _selectedTableId,
                              double _lowerLimit,
                              double _upperLimit)
Returns a panel containing a histogram. The data displayed in the histogram is given as parameter. Data not inside the given limits is discarded.

Parameters:
_dataElement - a DataElement containing the classifier sets of an iteration
_selectedTableId - identifier of the selected table (0 for population, 1 for match set, 2 for action set)
_lowerLimit - the lower limit that was entered by the user
_upperLimit - the upper limit that was entered by the user
Returns:
a JPanel containing the histogram

calculateHistogramData

public abstract Vector<Double> calculateHistogramData(DefaultTableModel _selectedTable)
Abstract method. Determines the data displayed in the histogram.

Parameters:
_selectedTable - the table that was selected by the user as basis for the histogram
Returns:
the data that will be displayed in the histogram

createHistogram

JPanel createHistogram(Vector<Double> _histogramData,
                       double _lowerLimit,
                       double _upperLimit)
Returns a panel containing a histogram. The data displayed in the histogram is given as parameter. Data not inside the given limits is discarded.

Parameters:
_histogramData - the data displayed in the histogram
_lowerLimit - the lower limit that was entered by the user
_upperLimit - the upper limit that was entered by the user
Returns:
a JPanel containing the histogram

createErrorPanel

private JPanel createErrorPanel(String _text)
Creates a panel for error messages. The error message is given as parameter.

Parameters:
_text - the error message
Returns:
a panel for error messages

valueWithinLimits

boolean valueWithinLimits(double _value,
                          double _lowerLimit,
                          double _upperLimit)
Tests if a given value lies within two limits.

Parameters:
_value - the value that will be tested
_lowerLimit - the lower limit for the test
_upperLimit - the upper limit for the test
Returns:
true iff _lowerlimit <= value <= _upperlimit

getNumberOfVisibleClassifiers

public int getNumberOfVisibleClassifiers()
Return the number of classifiers shown in the histogram.

Returns:
the number of classifiers shown in the histogram