Java Reference
In-Depth Information
Finally, the information on the discrete attributes is obtained
through the following code extracted from the class DiscreteStatistics-
Model, which also extends the AbstractTableModel class.
1.
public Object getValueAt(int iRowIndex, int iColumnIndex) {
if (mSelectedDiscreteStatistics null) {
2.
3.
return null;
4.
}
Object[] lValues
5.
6.
mSelectedDiscreteStatistics.getDiscreteValues();
Object lValue lValues[iRowIndex];
7.
8.
switch (iColumnIndex) {
9.
case 0:
10.
return lValue;
11.
case 1:
12.
try {
13.
return new Long(
14.
mSelectedDiscreteStatistics.
15.
getFrequency(lValue));
16.
} catch (JDMException e) {
17.
return "No Frequency";
18.
}
19.
}
20.
return null;
21.
}
This closes the section on retrieval of statistical information,
which is rather complete in JDM for univariate statistics.
13.3.5
Saving the Physical Dataset, Build Settings, and Tasks
When the user clicks on the Build Model button, the JDMBuildConsole
executes the method handlerCreateModelButton . The goal is to create
an appropriate BuildSettings object and BuildTask, and then to execute
the task. Because this method covers several pages of code, we will
discuss it in sections.
1. private void handlerCreateModelButton() {
2.
try {
3.
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
4.
createDatasetAndImportMetaData(mPhysicalDataset.getText());
5.
setDatasetKey((String) mKeyForAssociation.getSelectedItem());
6.
String lDSName getDatasetName(mModelNameTextField.getText());
7.
if (lDSName ! null) {
8.
saveDataset(lDSName, mOverwriteCheckBox.isSelected());
9.
} else {
 
Search WWH ::




Custom Search