// todo: adding getCount() to Rollup interface will simplify this block.
// because of inheritance, GaugeRollup needs to come before BasicRollup. sorry.
if (point.getData() instanceof GaugeRollup) {
GaugeRollup rollup = (GaugeRollup)point.getData();
numPoints += rollup.getCount();
filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
} else if (point.getData() instanceof BasicRollup) {
numPoints = ((BasicRollup) point.getData()).getCount();
filterStatsObject = getFilteredStatsForRollup((BasicRollup) point.getData(), filterStats);
} else if (point.getData() instanceof SimpleNumber) {
numPoints = 1;
filterStatsObject = getFilteredStatsForFullRes(point.getData(), filterStats);
} else if (point.getData() instanceof String) {
numPoints = 1;
filterStatsObject = getFilteredStatsForString((String) point.getData());
} else if (point.getData() instanceof Boolean) {
numPoints = 1;
filterStatsObject = getFilteredStatsForBoolean((Boolean) point.getData());
} else if (point.getData() instanceof SetRollup) {
SetRollup rollup = (SetRollup)point.getData();
numPoints += rollup.getCount();
filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
} else if (point.getData() instanceof TimerRollup) {
TimerRollup rollup = (TimerRollup)point.getData();
numPoints += rollup.getCount();
filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
} else if (point.getData() instanceof CounterRollup) {
CounterRollup rollup = (CounterRollup)point.getData();
numPoints += rollup.getCount().longValue();
filterStatsObject = getFilteredStatsForRollup(rollup, filterStats);
} else {
throw new SerializationException("Unsupported data type for Point");
}