if (standardDeviation == 0) { return new RangedClassifier( new Comparable[] {sdVisit.getMean()}, new Comparable[] {sdVisit.getMean()}); Double max[] = new Double[classNum]; for (int i = 0; i < classNum; i++) { min[i] = getMin(i, classNum, sdVisit.getMean(), standardDeviation); max[i] = getMax(i, classNum, sdVisit.getMean(), standardDeviation);
private Object calculate(SimpleFeatureCollection featureCollection) { try { int classNum = getClasses(); // find the standard deviation StandardDeviationVisitor sdVisit = new StandardDeviationVisitor(getExpression()); featureCollection.accepts(sdVisit, progress); if (progress != null && progress.isCanceled()) { return null; } CalcResult calcResult = sdVisit.getResult(); if (calcResult == null) { return null; } double standardDeviation = calcResult.toDouble(); //figure out the min and max values Double min[] = new Double[classNum]; Double max[] = new Double[classNum]; for (int i = 0; i < classNum; i++) { min[i] = getMin(i, classNum, sdVisit.getMean(), standardDeviation); max[i] = getMax(i, classNum, sdVisit.getMean(), standardDeviation); } return new RangedClassifier(min, max); } catch (IOException e) { LOGGER.log(Level.SEVERE, "StandardDeviationFunction calculate failed", e); return null; } }