CountAggregator

A CountAggregator is an Aggregator that counts the values for a property. The returned number is a Long, always zero or positive. It will not count null values, unless the property given is "*" (CountAggregator.COUNT_ALL). This Aggregator does not use floating-point calculations, so it does not override the terminateDoubleDouble method.

Usage

Create and use a CountAggregator, with one of the following methods:

  • Aggregator agg = new CountAggregator("property");
  • Aggregator agg = new CountAggregator(CountAggregator.COUNT_ALL);
  • Aggregator agg = Aggregator.getAggregator("Count(property)");
  • Aggregator agg = Aggregator.getAggregator("Count(*)");

There is no restriction on the type of property values expected.

The count is always a whole number, either 0 or a positive integer.