Java Reference
In-Depth Information
15.
if (mAttributeStatisticsSet
null) {
16.
JOptionPane.showMessageDialog(
17.
this,
18.
"No Statistics Available",
19.
"Null Statistics",
20.
JOptionPane.WARNING_MESSAGE);
21.
return;
22.
}
23.
mStatistics
mAttributeStatisticsSet.getStatistics();
24.
} catch (JDMException lException) {
25.
JOptionPane.showMessageDialog(
26.
this,
27.
lException.getMessage(),
28.
"JDMException",
29.
JOptionPane.WARNING_MESSAGE);
30.
lException.printStackTrace();
31.
return;
32.
}
33.
if (mStatistics
null) {
34.
JOptionPane.showMessageDialog(
35.
this,
36.
"Descriptive Statistics not supported",
37.
"JDM",
38.
JOptionPane.WARNING_MESSAGE);
39.
return;
40.
}
41. …
42. }
In this example, we removed the code dealing with graphical ini-
tialization. After the graphical component is created, the member
variable
mStatistics
holds the collection of all attribute statistics. The
code removed (noted by an ellipsis, …) around line 41 contains
graphical initialization as well as the following lines, which are also
activated whenever the user selects a new attribute:
1.
String lVarName
(String) mVariableList.getSelectedValue();
2.
UnivariateStatistics lStats
3.
mAttributeStatisticsSet.getStatistics(lVarName);
4.
mSelectedContinuousStatistics
lStats.getContinuousStatistics();
5.
((AbstractTableModel) mContinuousStatisticsTable.getModel()).
6.
fireTableDataChanged();
7.
mSelectedDiscreteStatistics
lStats.getDiscreteStatistics();
8.
updateDiscreteStatistics();
9.
mSelectedNumericalStatistics
lStats.getNumericalStatistics();
10.
updateNumericalStatistics();
In line 3, the statistics of the selected attribute are retrieved and
then the three kinds of statistics (continuous, discrete, and numerical)
Search WWH ::
Custom Search