001package jmri.jmrix;
002
003import java.util.Comparator;
004import java.util.ResourceBundle;
005import jmri.NamedBean;
006import jmri.util.NamedBeanPreferNumericComparator;
007
008/**
009 * For historical reasons, some NamedBean types have out-of-pattern system prefixes:
010 * <ul>
011 * <li>OBlocks use O (as in OB)
012 * <li>RailCom tags use R
013 * <li>Transponding tags use L
014 * </ul>
015 * This {@link jmri.SystemConnectionMemo} implementation is meant to handle these
016 * by providing connection memo services without being connected to a particular system
017 * instantiation.
018 * <p>
019 * An object of this class does not get registered
020 * with the {@link jmri.InstanceManager} and is likely to have a system prefix
021 * and user name that conflict with the default values of another, user
022 * controllable, manager.
023 * This SystemConnectionMemo is not intended to be
024 * invoked on any system connection that is configurable by the user.
025 * Note that this is handled as a special case in
026 * {@link DefaultSystemConnectionMemo}.
027 * <p>
028 * Though not deprecated per se, this should not be used in new code.  Instead.
029 * please use an {@link jmri.jmrix.internal.InternalSystemConnectionMemo}.
030 *
031 * @author Randall Wood Copyright 2019
032 */
033public class CaptiveSystemConnectionMemo extends DefaultSystemConnectionMemo {
034
035    public CaptiveSystemConnectionMemo(String prefix, String userName) {
036        super(prefix, userName);
037    }
038
039    @Override
040    protected ResourceBundle getActionModelResourceBundle() {
041        return null; // no resource bundle
042    }
043
044    @Override
045    public <B extends NamedBean> Comparator<B> getNamedBeanComparator(Class<B> type) {
046        return new NamedBeanPreferNumericComparator<>();
047    }
048
049    @Override
050    public void register() {
051        // do nothing
052    }
053}