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

org.heigit.ohsome.oshdb.api.mapreducer.MapFunction Maven / Gradle / Ivy

Go to download

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

The newest version!
package org.heigit.ohsome.oshdb.api.mapreducer;

import org.heigit.ohsome.oshdb.util.function.SerializableBiFunction;

/**
 * A function that has a flag: isFlatMapper.
 *
 * 

Note that this class is using raw types on purpose because MapReducer's "map functions" * are designed to input and output arbitrary data types. The necessary type checks are performed * at at runtime in the respective setters.

*/ @SuppressWarnings({"rawtypes", "unchecked"}) // see javadoc above class MapFunction implements SerializableBiFunction { private final SerializableBiFunction mapper; private final boolean isFlatMapper; MapFunction(SerializableBiFunction mapper, boolean isFlatMapper) { this.mapper = mapper; this.isFlatMapper = isFlatMapper; } boolean isFlatMapper() { return this.isFlatMapper; } @Override public Object apply(Object o, Object root) { return this.mapper.apply(o, root); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy