001package jmri;
002
003import org.jdom2.Element;
004
005/**
006 * BasicRosterEntry represents a single element in a locomotive roster, including
007 * information on how to locate it from decoder information.
008 * <p>
009 * This interface is to allow access to the Basic details of a Roster
010 * entry.
011 * <p>
012 * Primarily this only deals as a method to provide other packages with access
013 * to the information rather than being able set or create items. However access
014 * to set and get Attributes is allowed so that attributes like running duration
015 * can be recorded, with the store option also available.
016 * <p>
017 * This interface should probably be called RosterEntry, but this would result in another class 
018 * with the same name; refactoring of that class would be a big job and would potentially cause issue
019 * with users scripts etc.
020 * <p>
021 * For Full read/write and creation of RosterEntries use the @link
022 * jmri.jmrit.roster.RosterEntry
023 * <p>
024 * All properties, including the "Attributes", are bound.
025 *
026 * @author Bob Jacobsen Copyright (C) 2001, 2002, 2004, 2005, 2009
027 * @author Kevin Dickerson Copyright 2012
028 * @see jmri.jmrit.roster.RosterEntry
029 *
030 */
031public interface BasicRosterEntry {
032
033    String getId();
034
035    String getDccAddress();
036
037    boolean isLongAddress();
038
039    DccLocoAddress getDccLocoAddress();
040
041    String getShuntingFunction();
042
043    void setOpen(boolean boo);
044
045    boolean isOpen();
046
047    void putAttribute(String key, String value);
048
049    String getAttribute(String key);
050
051    void deleteAttribute(String key);
052
053    String[] getAttributeList();
054
055    int getMaxSpeedPCT();
056
057    /**
058     * Create an XML element to represent this Entry. This member has to remain
059     * synchronized with the detailed schema in
060     * xml/schema/locomotive-config.xsd.
061     *
062     * @return Contents in a JDOM Element
063     */
064    Element store();
065
066    String titleString();
067
068    @Override
069    String toString();
070
071    void addPropertyChangeListener(java.beans.PropertyChangeListener l);
072
073    void removePropertyChangeListener(java.beans.PropertyChangeListener l);
074
075}