All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.heigit.bigspatialdata.oshdb.api.mapreducer.MapAggregatable Maven / Gradle / Ivy

Go to download

API to query the OpenStreetMap History Database. Includes MapReduce functionality to filter, analyze and aggregate data.

There is a newer version: 1.2.3
Show newest version
package org.heigit.bigspatialdata.oshdb.api.mapreducer;

import java.io.Serializable;
import org.heigit.bigspatialdata.oshdb.api.generic.function.SerializableFunction;

/**
 * Interface for MapReducers or MapAggregators that can be aggregated by an arbitrary index.
 *
 * @param  the resulting class of the aggregateBy operation
 * @param  the data type the index function is supplied with
 */
interface MapAggregatable {
  /**
   * Sets a custom aggregation function that is used to (further) group output results into.
   *
   * @param indexer a function that will be called for each input element and returns a value that
   *        will be used to group the results by
   * @param  data type of the values used to aggregate the output. has to be a comparable type
   * @return a MapAggregator object with the equivalent state (settings, filters, map function,
   *         etc.) of the current MapReducer object
   */
   & Serializable> M aggregateBy(SerializableFunction indexer);
}