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

org.coode.oppl.function.StringManipulationOPPLFunction Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
package org.coode.oppl.function;

import static org.coode.oppl.utils.ArgCheck.checkNotNull;

import org.coode.oppl.exceptions.RuntimeExceptionHandler;

/** @author Luigi Iannone */
public abstract class StringManipulationOPPLFunction implements OPPLFunction {
    private final OPPLFunction argument;

    /** @param argument
     *            argument */
    public StringManipulationOPPLFunction(OPPLFunction argument) {
        this.argument = checkNotNull(argument, "argument");
    }

    @Override
    public String compute(ValueComputationParameters params) {
        String argumentValue = getArgument().compute(params);
        String toReturn = manipulate(argumentValue, params.getRuntimeExceptionHandler());
        return toReturn;
    }

    protected abstract String manipulate(String string,
            RuntimeExceptionHandler runTimeExceptionHandler);

    /** @param visitor
     *            visitor */
    public abstract void accept(StringManipulationOPPLFunctionVisitor visitor);

    /** @param visitor
     *            visitor
     * @param 
     *            visitor return type
     * @return visitor value */
    public abstract  O accept(StringManipulationOPPLFunctionVisitorEx visitor);

    /** @return the argument */
    public OPPLFunction getArgument() {
        return argument;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy