001package jmri;
002
003import java.util.Enumeration;
004
005/**
006 * A SignalSystem defines a signalling system by representing the properties of
007 * various signal aspects it contains.
008 * <p>
009 * At present, the signal aspects are enumerated by Strings, not by specific
010 * objects; this table exists to attach properties to those Strings.
011 * <p>
012 * Setting or getting the "state" of one of these will throw an error.
013 * <p>
014 * You'll have one of these objects for each signaling _system_ on your
015 * railroad. In turn, these will be used by 1 to N specific mappings to
016 * appearances, see e.g. {@link jmri.SignalAppearanceMap}.
017 * <p>
018 * Insertion order is preserved when retrieving keys.
019 * <hr>
020 * This file is part of JMRI.
021 * <p>
022 * JMRI is free software; you can redistribute it and/or modify it under the
023 * terms of version 2 of the GNU General Public License as published by the Free
024 * Software Foundation. See the "COPYING" file for a copy of this license.
025 * <p>
026 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
027 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
028 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
029 *
030 * @author Bob Jacobsen Copyright (C) 2009
031 */
032public interface SignalSystem extends NamedBean {
033
034    void setProperty(String aspect, String key, Object value);
035
036    Object getProperty(String aspect, String key);
037
038    /**
039     * Add an image or icon type available for use with this signaling system.
040     *
041     * @param type the image type
042     */
043    void setImageType(String type);
044
045    /**
046     * Returns a list of the image/icon sets available for use with this
047     * signaling system.
048     *
049     * @return all image types or an empty list
050     */
051    Enumeration<String> getImageTypeList();
052
053    /**
054     * Get all aspects currently defined.
055     *
056     * @return all aspects or an empty list
057     */
058    Enumeration<String> getAspects();  // eventually, change to return Set<>
059
060    /**
061     * Get all keys currently defined on any aspect.
062     * <p>
063     * Each key only appears once, even if used on more than one aspect.
064     * <p>
065     * Note that a given key may or may not appear on a given aspect.
066     *
067     * @return all keys or an empty list
068     */
069    Enumeration<String> getKeys(); // eventually, change to return Set<>
070
071    /**
072     * Is this aspect known?
073     *
074     * @param aspect the aspect to check
075     * @return true if known; false otherwise
076     */
077    boolean checkAspect(String aspect);
078
079    String getAspect(Object obj, String key);
080
081    float getMaximumLineSpeed();
082    
083    /**
084     * Provide a multi-line summary of the signal system content,
085     * typically for printing.
086     * <p>
087     * Not intended for further parsing, 
088     * i.e. for persistance, as format likely to differ from type 
089     * to type, and to change often.
090     * @return summary string.
091     */
092    String summary();
093
094}