001package jmri.jmrit.logixng.util.parser.functions;
002
003import jmri.jmrit.logixng.util.parser.*;
004
005/**
006 * Abstract class to help writing LogixNG functions easier.
007 *
008 * @author Daniel Bergqvist 2024
009 */
010public abstract class AbstractFunction implements Function {
011
012    private final FunctionFactory _functionFactory;
013    private final String _name;
014    private final String _description;
015
016    public AbstractFunction(FunctionFactory functionFactory, String name, String description) {
017        _functionFactory = functionFactory;
018        _name = name;
019        _description = description;
020    }
021
022    @Override
023    public String getModule() {
024        return _functionFactory.getModule();
025    }
026
027    @Override
028    public String getConstantDescriptions() {
029        return _functionFactory.getConstantDescription();
030    }
031
032    @Override
033    public String getName() {
034        return _name;
035    }
036
037    @Override
038    public String getDescription() {
039        return _description;
040    }
041}