001package jmri.jmrit.logixng.tools.debugger;
002
003import java.util.Set;
004
005import jmri.JmriException;
006import jmri.NamedBean;
007import jmri.jmrit.logixng.BaseManager;
008import jmri.jmrit.logixng.MaleDigitalBooleanActionSocket;
009
010/**
011 *
012 * @author daniel
013 */
014public class DebuggerMaleDigitalBooleanActionSocket extends AbstractDebuggerMaleSocket implements MaleDigitalBooleanActionSocket {
015
016    private boolean _nextValue;
017
018    public DebuggerMaleDigitalBooleanActionSocket(BaseManager<MaleDigitalBooleanActionSocket> manager, MaleDigitalBooleanActionSocket maleSocket) {
019        super(manager, maleSocket);
020    }
021
022    /** {@inheritDoc} */
023    @Override
024    public String getBeforeInfo() {
025        return Bundle.getMessage("DigitalBooleanAction_InfoBefore",
026                _nextValue ? Bundle.getMessage("True") : Bundle.getMessage("False"));
027    }
028
029    /** {@inheritDoc} */
030    @Override
031    public String getAfterInfo() {
032        return Bundle.getMessage("DigitalBooleanAction_InfoAfter");
033    }
034
035    @Override
036    public void execute(boolean value) throws JmriException {
037        _nextValue = value;
038        before();
039        ((MaleDigitalBooleanActionSocket)getObject()).execute(value);
040        after();
041    }
042
043    @Override
044    public void setState(int s) throws JmriException {
045        ((MaleDigitalBooleanActionSocket)getObject()).setState(s);
046    }
047
048    @Override
049    public int getState() {
050        return ((MaleDigitalBooleanActionSocket)getObject()).getState();
051    }
052
053    @Override
054    public String describeState(int state) {
055        return ((MaleDigitalBooleanActionSocket)getObject()).describeState(state);
056    }
057
058    @Override
059    public void setProperty(String key, Object value) {
060        ((MaleDigitalBooleanActionSocket)getObject()).setProperty(key, value);
061    }
062
063    @Override
064    public Object getProperty(String key) {
065        return ((MaleDigitalBooleanActionSocket)getObject()).getProperty(key);
066    }
067
068    @Override
069    public void removeProperty(String key) {
070        ((MaleDigitalBooleanActionSocket)getObject()).removeProperty(key);
071    }
072
073    @Override
074    public Set<String> getPropertyKeys() {
075        return ((MaleDigitalBooleanActionSocket)getObject()).getPropertyKeys();
076    }
077
078    @Override
079    public String getBeanType() {
080        return ((MaleDigitalBooleanActionSocket)getObject()).getBeanType();
081    }
082
083    @Override
084    public int compareSystemNameSuffix(String suffix1, String suffix2, NamedBean n2) {
085        return ((MaleDigitalBooleanActionSocket)getObject()).compareSystemNameSuffix(suffix1, suffix2, n2);
086    }
087
088}