NumberFormat nf = NumberFormat.getNumberInstance(locale);
if (stats != null) {
for (int i=0; i < stats.length; i++) {
Map statMap = new HashMap();
if (stats[i] instanceof BoundedRangeStatistic) {
BoundedRangeStatistic stat = (BoundedRangeStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", nf.format(stat.getCurrent()) + " " + stat.getUnit());
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details",
GuiUtil.getMessage("monitoring.HighWater")+ ": " + nf.format(stat.getHighWaterMark()) + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.LowWater")+": " + nf.format(stat.getLowWaterMark()) + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.UpperBound")+": " + nf.format(stat.getUpperBound()) + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.LowerBound")+": " + nf.format(stat.getLowerBound())+ " " + stat.getUnit()+ "<br/>");
} else if (stats[i] instanceof BoundaryStatistic) {
BoundaryStatistic stat = (BoundaryStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", "");
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details",
GuiUtil.getMessage("monitoring.UpperBound")+": " + stat.getUpperBound() + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.LowerBound")+": " + stat.getLowerBound()+ " " + stat.getUnit()+ "<br/>");
} else if (stats[i] instanceof RangeStatistic) {
RangeStatistic stat = (RangeStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", stat.getCurrent() + " " + stat.getUnit());
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details",
GuiUtil.getMessage("monitoring.HighWater")+": " + stat.getHighWaterMark() + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.LowWater")+": " + stat.getLowWaterMark() + " " + stat.getUnit()+ "<br/>");
} else if (stats[i] instanceof CountStatistic) {
CountStatistic stat = (CountStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", stat.getCount() + " " + stat.getUnit());
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details", "");
} else if (stats[i] instanceof TimeStatistic) {
TimeStatistic stat = (TimeStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", stat.getCount() + " " + stat.getUnit());
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details",
GuiUtil.getMessage("monitoring.MaxTime")+": " + stat.getMaxTime() + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.MinTime")+": " + stat.getMinTime() + " " + stat.getUnit() + "<br/>" +
GuiUtil.getMessage("monitoring.TotalTime")+": " + stat.getTotalTime() + " " + stat.getUnit()+ "<br/>");
} else if (stats[i] instanceof StringStatistic) {
StringStatistic stat = (StringStatistic)stats[i];
statMap.put("Name", stat.getName());
statMap.put("Value", stat.getCurrent());
statMap.put("Description", stat.getDescription());
statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
statMap.put("Details", "");
} else if (stats[i] instanceof Statistic) {
statMap.put("Name", stats[i].getName());
statMap.put("Value", stats[i].getUnit());
statMap.put("Description", stats[i].getDescription());