- possibleCenters.setSize(size);\r
- // We need to pick the best three. Find the most\r
- // popular ones whose module size is nearest the average\r
- float averageModuleSize = 0.0f;\r
- for (int i = 0; i < size; i++) {\r
- averageModuleSize += ((FinderPattern) possibleCenters.elementAt(i)).getEstimatedModuleSize();\r
- }\r
- averageModuleSize /= (float) size;\r
- // We don't have java.util.Collections in J2ME\r
- Collections.insertionSort(possibleCenters, new ClosestToAverageComparator(averageModuleSize));\r
+ possibleCenters.setSize(3);\r
+ }\r
+ // We need to pick the best three. Find the most\r
+ // popular ones whose module size is nearest the average\r
+ float averageModuleSize = 0.0f;\r
+ for (int i = 0; i < 3; i++) {\r
+ averageModuleSize += ((FinderPattern) possibleCenters.elementAt(i)).getEstimatedModuleSize();\r