Java Reference
In-Depth Information
23.
lDialog.pack();
24.
lDialog.setVisible(true);
25.
} catch (JDMException lException) {
26.
displayJDMException(lException);
27.
}
28. }
Statistical information is obtained through the
PhysicalDataSet
attribute information. It is expected that not all DME implementa-
tions will support statistics computations, so the capability
Mining-
Task.computeStatisticsTask
must be tested. The actual work occurs in
the
retrievePhysicalDataSet
method. To avoid redundant computation
if the
Stats
button is clicked twice on the same URI reference, we will
save the
PhysicalDataSet
into the MOR with its statistics (giving it the
specific name
RetrieveStatsDS
); if we retrieve this dataset from the
MOR with a URI equal to the one currently specified, we will not
rerun the task to update the statistical information, as shown next:
1. private PhysicalDataSet retrievePhysicalDataset() throws JDMException {
2.
if (mDmeConn.doesObjectExist("RetrieveStatsDS",
3.
NamedObject.physicalDataSet)) {
4.
PhysicalDataSet lPhysicalDS
5.
(PhysicalDataSet) mDmeConn.retrieveObject(
6.
"RetrieveStatsDS", NamedObject.physicalDataSet);
7.
if (lPhysicalDS.getURI().equals(mBuildData.getURI())) {
8.
return lPhysicalDS;
9.
}
10.
}
11.
ComputeStatisticsTaskFactory lTaskFactory
12.
(ComputeStatisticsTaskFactory) mDmeConn.getFactory(
13.
"javax.datamining.task.ComputeStatisticsTask");
14.
mDmeConn.saveObject("RetrieveStatsDS", mBuildData, true);
15.
ComputeStatisticsTask lTask
16.
lTaskFactory.create("RetrieveStatsDS");
17.
VerificationReport lVerifTask
lTask.verify();
18.
if (lVerifTask !
null) {
19.
displayLongMessage(this, "Wrong Task",
20.
lVerifTask.getReportText(),
21.
JOptionPane.INFORMATION_MESSAGE);
22.
return null;
23.
}
24.
mDmeConn.saveObject("RetrieveStatsTask", lTask, true);
25.
// Run the task.
26.
ExecutionHandle lBuildHandle
27.
mDmeConn.execute("RetrieveStatsTask");
28.
if (monitorTaskExecution(lBuildHandle)) {
29.
return (PhysicalDataSet) mDmeConn.retrieveObject(
Search WWH ::
Custom Search