Interface SymbolTable

    • Field Detail

      • log

        static final org.slf4j.Logger log
    • Method Detail

      • getSymbolValues

        java.util.Map<java.lang.String,​java.lang.Object> getSymbolValues()
        The list of symbols and their values in the table
        Returns:
        the name of the symbols and their values
      • getValue

        java.lang.Object getValue​(java.lang.String name)
        Get the value of a symbol
        Parameters:
        name - the name
        Returns:
        the value
      • hasValue

        boolean hasValue​(java.lang.String name)
        Is the symbol in the symbol table?
        Parameters:
        name - the name
        Returns:
        true if the symbol exists, false otherwise
      • setValue

        void setValue​(java.lang.String name,
                      java.lang.Object value)
        Set the value of a symbol
        Parameters:
        name - the name
        value - the value
      • createSymbols

        void createSymbols​(SymbolTable symbolTable,
                           java.util.Collection<? extends SymbolTable.VariableData> symbolDefinitions)
                    throws JmriException
        Add new symbols to the symbol table. This method is used for parameters, when new symbols might be created that uses symbols from a previous symbol table.
        Parameters:
        symbolTable - the symbol table to get existing symbols from
        symbolDefinitions - the definitions of the new symbols
        Throws:
        JmriException - if an exception is thrown
      • printSymbolTable

        void printSymbolTable​(java.io.PrintWriter stream)
        Print the symbol table on a stream
        Parameters:
        stream - the stream
      • validateName

        static boolean validateName​(java.lang.String name)
        Validates the name of a symbol
        Parameters:
        name - the name
        Returns:
        true if the name is valid, false otherwise
      • getStack

        Stack getStack()
        Get the stack. This method is only used internally by DefaultSymbolTable.
        Returns:
        the stack
      • printVariable

        static void printVariable​(org.slf4j.Logger log,
                                  java.lang.String pad,
                                  java.lang.String name,
                                  java.lang.Object value,
                                  boolean expandArraysAndMaps,
                                  java.lang.String headerName,
                                  java.lang.String headerValue)
        Print a variable
        Parameters:
        log - the logger
        pad - the padding
        name - the name
        value - the value
        expandArraysAndMaps - true if arrays and maps should be expanded, false otherwise
        headerName - header for the variable name
        headerValue - header for the variable value