private double getMax(ImageServiceBean bean) { if (bean.getMaximumCutBound() == null || bean.getMaximumCutBound().getBound() == null) { return bean.getMax().doubleValue(); } return Math.min( bean.getMax().doubleValue(), bean.getMaximumCutBound().getBound().doubleValue()); }
private void createMaxMin(ImageServiceBean bean) { double[] stats = null; if (bean.getMin() == null) { if (stats == null) stats = getFastStatistics(bean); // do not get unless have to bean.setMin(stats[0]); } if (bean.getMax() == null) { if (stats == null) stats = getFastStatistics(bean); // do not get unless have to bean.setMax(stats[1]); } }