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

org.nasdanika.common.MapCompoundFunction Maven / Gradle / Ivy

There is a newer version: 2024.11.0
Show newest version
package org.nasdanika.common;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

public class MapCompoundFunction 
	extends MapCompoundExecutionParticipant> 
	implements Function>  {

	public MapCompoundFunction(String name) {
		super(name);
	}

	public MapCompoundFunction(String name, Map> functions) {
		super(name);
		functions.forEach(this::put);
	}

	@Override
	public Map execute(T arg, ProgressMonitor progressMonitor) {
		progressMonitor.setWorkRemaining(size());
		Map result = new LinkedHashMap<>();
		for (Entry> e: elements.entrySet()) {
			Function value = e.getValue();
			if (value != null) {
				result.put(e.getKey(), value.splitAndExecute(arg, progressMonitor));			
			}
		}
		return result;
	}	

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy