io.virtdata.templates.StringBindings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of virtdata-lib-curves4 Show documentation
Show all versions of virtdata-lib-curves4 Show documentation
Statistical sampling library for use in virtualdataset libraries, based on apache commons math 4
package io.virtdata.templates;
import io.virtdata.api.Binder;
import io.virtdata.core.Bindings;
/**
* Allows the generation of strings from a string template and bindings template.
*/
public class StringBindings implements Binder {
private final StringCompositor compositor;
private Bindings bindings;
public StringBindings(StringCompositor compositor, Bindings bindings) {
this.compositor = compositor;
this.bindings = bindings;
}
/**
* Call the data mapper bindings, assigning the returned values positionally to the anchors in the string binding.
* @param value a long input value
* @return a new String containing the mapped values
*/
@Override
public String bind(long value) {
String s = compositor.bindValues(compositor,bindings,value);
return s;
}
}