Class DefaultSignalSystem

    • Field Detail

      • aspects

        protected java.util.HashMap<java.lang.String,​java.util.Hashtable<java.lang.String,​java.lang.Object>> aspects
      • keys

        protected java.util.Vector<java.lang.String> keys
      • imageTypes

        protected java.util.Vector<java.lang.String> imageTypes
    • Constructor Detail

      • DefaultSignalSystem

        public DefaultSignalSystem​(java.lang.String systemName,
                                   java.lang.String userName)
    • Method Detail

      • setProperty

        public void setProperty​(java.lang.String aspect,
                                java.lang.String key,
                                java.lang.Object value)
        Specified by:
        setProperty in interface SignalSystem
      • setImageType

        public void setImageType​(java.lang.String type)
        Description copied from interface: SignalSystem
        Add an image or icon type available for use with this signaling system.
        Specified by:
        setImageType in interface SignalSystem
        Parameters:
        type - the image type
      • getImageTypeList

        public java.util.Enumeration<java.lang.String> getImageTypeList()
        Description copied from interface: SignalSystem
        Returns a list of the image/icon sets available for use with this signaling system.
        Specified by:
        getImageTypeList in interface SignalSystem
        Returns:
        all image types or an empty list
      • getTable

        protected java.util.Hashtable<java.lang.String,​java.lang.Object> getTable​(java.lang.String aspect)
      • getAspects

        public java.util.Enumeration<java.lang.String> getAspects()
        Description copied from interface: SignalSystem
        Get all aspects currently defined.
        Specified by:
        getAspects in interface SignalSystem
        Returns:
        all aspects or an empty list
      • getKeys

        public java.util.Enumeration<java.lang.String> getKeys()
        Description copied from interface: SignalSystem
        Get all keys currently defined on any aspect.

        Each key only appears once, even if used on more than one aspect.

        Note that a given key may or may not appear on a given aspect.

        Specified by:
        getKeys in interface SignalSystem
        Returns:
        all keys or an empty list
      • checkAspect

        public boolean checkAspect​(java.lang.String aspect)
        Description copied from interface: SignalSystem
        Is this aspect known?
        Specified by:
        checkAspect in interface SignalSystem
        Parameters:
        aspect - the aspect to check
        Returns:
        true if known; false otherwise
      • getState

        public int getState()
        Provide generic access to internal state.

        This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read. This method returns a constant result on the DefaultSignalSystem.

        Specified by:
        getState in interface NamedBean
        Returns:
        NamedBean.INCONSISTENT
      • setState

        public void setState​(int s)
        Provide generic access to internal state.

        This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read. This method has no effect on the DefaultSignalSystem.

        Specified by:
        setState in interface NamedBean
        Parameters:
        s - the state
      • getBeanType

        public java.lang.String getBeanType()
        Description copied from interface: NamedBean
        For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.
        Specified by:
        getBeanType in interface NamedBean
        Returns:
        a string of the bean type, eg Turnout, Sensor etc
      • summary

        public java.lang.String summary()
        Description copied from interface: SignalSystem
        Provide a multi-line summary of the signal system content, typically for printing.

        Not intended for further parsing, i.e. for persistance, as format likely to differ from type to type, and to change often.

        Specified by:
        summary in interface SignalSystem
        Returns:
        summary string.