com.github.TKnudsen.ComplexDataObject.view.VisualMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of complex-data-object Show documentation
Show all versions of complex-data-object Show documentation
A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.
package com.github.TKnudsen.ComplexDataObject.view;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import com.github.TKnudsen.ComplexDataObject.data.interfaces.IDObject;
/**
*
* Title: VisualMapping
*
*
*
* Description: provides the basic functionality for mapping abstract data into
* the visual space.
*
*
*
* Copyright: Copyright (c) 2015-2016
*
*
* @author Juergen Bernard
* @TODO: define visual variable data structure
*/
public abstract class VisualMapping implements Function {
protected Map mappingLookup = new HashMap();
protected abstract M calculateMapping(T t);
@Override
public M apply(T t) {
if (mappingLookup.get(t) == null)
mappingLookup.put(t, calculateMapping(t));
return mappingLookup.get(t);
}
}