MaxAggregator

A MaxAggregator is an Aggregator that determines and returns the maximum of the property values. If no values were encountered, then the maximum is null. This Aggregator does not use floating-point calculations, so it does not override the terminateDoubleDouble method.

Usage

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

  • Aggregator agg = new MaxAggregator("property");
  • Aggregator agg = Aggregator.getAggregator("Max(property)");

The values returned by the property of the object must be Comparable. This includes, but is not limited to, all numeric values and Strings.

The value's "compareTo" method may be called to establish which object is the maximum.