com.tangosol.util.aggregator.AbstractComparableAggregator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coherence Show documentation
Show all versions of coherence Show documentation
Oracle Coherence Community Edition
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.util.aggregator;
import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.util.ValueExtractor;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Comparator;
import javax.json.bind.annotation.JsonbProperty;
/**
* Abstract aggregator that processes values extracted from a set of entries
* in a Map, with knowledge of how to compare those values. There are two way
* to use the AbstractComparableAggregator:
*
* - All the extracted objects must implement {@link Comparable}, or
* - The AbstractComparableAggregator has to be provided with a
* {@link Comparator} object.
*
* If the set of entries passed to {@link #accumulate} is empty, a
* null result is returned.
*
* @param the type of the value to extract from
* @param the type of the aggregation result
*
* @author gg 2006.02.13
* @since Coherence 3.2
*/
public abstract class AbstractComparableAggregator
extends AbstractAggregator