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.MaleAnalogExpressionSocket; 009 010/** 011 * 012 * @author daniel 013 */ 014public class DebuggerMaleAnalogExpressionSocket extends AbstractDebuggerMaleSocket implements MaleAnalogExpressionSocket { 015 016 private double _lastResult; 017 018 public DebuggerMaleAnalogExpressionSocket(BaseManager<MaleAnalogExpressionSocket> manager, MaleAnalogExpressionSocket maleSocket) { 019 super(manager, maleSocket); 020 } 021 022 /** {@inheritDoc} */ 023 @Override 024 public String getBeforeInfo() { 025 return Bundle.getMessage("AnalogExpression_InfoBefore", _lastResult); 026 } 027 028 /** {@inheritDoc} */ 029 @Override 030 public String getAfterInfo() { 031 return Bundle.getMessage("AnalogExpression_InfoAfter", _lastResult); 032 } 033 034 @Override 035 public double evaluate() throws JmriException { 036 before(); 037 _lastResult = ((MaleAnalogExpressionSocket)getObject()).evaluate(); 038 after(); 039 return _lastResult; 040 } 041 042 @Override 043 public void setState(int s) throws JmriException { 044 ((MaleAnalogExpressionSocket)getObject()).setState(s); 045 } 046 047 @Override 048 public int getState() { 049 return ((MaleAnalogExpressionSocket)getObject()).getState(); 050 } 051 052 @Override 053 public String describeState(int state) { 054 return ((MaleAnalogExpressionSocket)getObject()).describeState(state); 055 } 056 057 @Override 058 public void setProperty(String key, Object value) { 059 ((MaleAnalogExpressionSocket)getObject()).setProperty(key, value); 060 } 061 062 @Override 063 public Object getProperty(String key) { 064 return ((MaleAnalogExpressionSocket)getObject()).getProperty(key); 065 } 066 067 @Override 068 public void removeProperty(String key) { 069 ((MaleAnalogExpressionSocket)getObject()).removeProperty(key); 070 } 071 072 @Override 073 public Set<String> getPropertyKeys() { 074 return ((MaleAnalogExpressionSocket)getObject()).getPropertyKeys(); 075 } 076 077 @Override 078 public String getBeanType() { 079 return ((MaleAnalogExpressionSocket)getObject()).getBeanType(); 080 } 081 082 @Override 083 public int compareSystemNameSuffix(String suffix1, String suffix2, NamedBean n2) { 084 return ((MaleAnalogExpressionSocket)getObject()).compareSystemNameSuffix(suffix1, suffix2, n2); 085 } 086 087 @Override 088 public void setTriggerOnChange(boolean triggerOnChange) { 089 ((MaleAnalogExpressionSocket)getObject()).setTriggerOnChange(triggerOnChange); 090 } 091 092 @Override 093 public boolean getTriggerOnChange() { 094 return ((MaleAnalogExpressionSocket)getObject()).getTriggerOnChange(); 095 } 096 097}