001package jmri.jmrit.logixng;
002
003import jmri.JmriException;
004
005/**
006 * String expression is used in LogixNG to answer a question that can give
007 * a string value as result.
008 * 
009 * @author Daniel Bergqvist Copyright 2018
010 */
011public interface StringExpression extends Base {
012    
013    /**
014     * Evaluate this expression.
015     * 
016     * @return the result of the evaluation
017     * @throws JmriException when an exception occurs
018     */
019    String evaluate() throws JmriException;
020    
021    /**
022     * Set whenether this expression should trigger the ConditionalNG if the
023     * named beans it listens to changes state.
024     * @param triggerOnChange true if trigger on change, false otherwise
025     */
026    void setTriggerOnChange(boolean triggerOnChange);
027    
028    /**
029     * Get whenether this expression should trigger the ConditionalNG if the
030     * named beans it listens to changes state.
031     * @return true if trigger on change, false otherwise
032     */
033    boolean getTriggerOnChange();
034    
035}