001package jmri.jmrit.logixng.implementation; 002 003import java.util.List; 004import java.util.Locale; 005import java.util.Map; 006 007import jmri.InstanceManager; 008import jmri.JmriException; 009import jmri.jmrit.logixng.*; 010 011/** 012 * Default implementation of the Female Digital Boolean Action socket 013 */ 014public final class DefaultFemaleDigitalBooleanActionSocket 015 extends AbstractFemaleSocket 016 implements FemaleDigitalBooleanActionSocket { 017 018 019 public DefaultFemaleDigitalBooleanActionSocket(Base parent, FemaleSocketListener listener, String name) { 020 super(parent, listener, name); 021 } 022 023 @Override 024 public boolean isCompatible(MaleSocket socket) { 025 return socket instanceof MaleDigitalBooleanActionSocket; 026 } 027 028 @Override 029 public void execute(boolean value) throws JmriException { 030 if (isConnected()) { 031 ((MaleDigitalBooleanActionSocket)getConnectedSocket()).execute(value); 032 } 033 } 034 035 @Override 036 public String getShortDescription(Locale locale) { 037 return Bundle.getMessage(locale, "DefaultFemaleDigitalBooleanActionSocket_Short"); 038 } 039 040 @Override 041 public String getLongDescription(Locale locale) { 042 return Bundle.getMessage(locale, "DefaultFemaleDigitalBooleanActionSocket_Long", getName()); 043 } 044 045 @Override 046 public Map<Category, List<Class<? extends Base>>> getConnectableClasses() { 047 return InstanceManager.getDefault(DigitalBooleanActionManager.class).getActionClasses(); 048 } 049 050 /** {@inheritDoc} */ 051 @Override 052 public void disposeMe() { 053 // Do nothing 054 } 055 056}