kokx/tue-2io21 — pull request #4 by MaeghsB (2012-05-11 12:05:53+00:00)
Title: remade quality index program

CHANGELOG

--BUGFIXES--
in Cluster:
- Fixed scatter calculation.

--REFACTORINGS--
in Main:
- checkClusterExists refactored to remove unnecessary variables and IF checks.
- moved the initialization of the scanner to it's declaration, constructor is thus redundant and removed.
- removed unnecessary call to the processOneInput method from the run method.
- creation of the quality object and printing it's score has been merged into one line.
- processOneInput refactored to reduce the use of auxiliary variables.
in Cluster:
- removed the dead variable Quality and its getter and setter methods.
in Quality:
- mode parameter was used in all methods, now it is simply a class variable.
- inputList in contructor renamed to inputs.
- class variables are now private.
- new method calcTotalScatterFactor which takes over most of the functionality of calcQualityIndex, but much more efficient (2 loops and an arraylist -> 1 loop).
- calcMaxScatterDistenceFactorv cleaned up and split into functions according to the definitions instead of getting stuffed into one method.
- calcQualityIndex removed, this is now handled in the same way as getScatter and getCentroid of the Cluster class.

--OTHER--
in Quality:
- java.util.ArrayList changed to java.util.*. (AFAIK not using * should only gives conflicts with none standard packages?, changed anyway to be sure)
- added javadoc