Class DefaultSymbolTable

    • Constructor Detail

      • DefaultSymbolTable

        public DefaultSymbolTable()
        Create a new instance of DefaultSymbolTable with no previous symbol table.
      • DefaultSymbolTable

        public DefaultSymbolTable​(ConditionalNG currentConditionalNG)
        Create a new instance of DefaultSymbolTable with previous symbol table and the stack from a ConditionalNG.
        Parameters:
        currentConditionalNG - the ConditionalNG
      • DefaultSymbolTable

        public DefaultSymbolTable​(SymbolTable prevSymbolTable)
        Create a new instance of DefaultSymbolTable from a previous symbol table and a stack.
        Parameters:
        prevSymbolTable - the previous symbol table
    • Method Detail

      • getSymbolValues

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

        public java.lang.Object getValue​(java.lang.String name)
        Get the value of a symbol
        Specified by:
        getValue in interface SymbolTable
        Parameters:
        name - the name
        Returns:
        the value
      • hasValue

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

        public void setValue​(java.lang.String name,
                             java.lang.Object value)
        Set the value of a symbol
        Specified by:
        setValue in interface SymbolTable
        Parameters:
        name - the name
        value - the value
      • createSymbols

        public 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.
        Specified by:
        createSymbols in interface SymbolTable
        Parameters:
        symbolTable - the symbol table to get existing symbols from
        symbolDefinitions - the definitions of the new symbols
        Throws:
        JmriException - if an exception is thrown
      • getStack

        public Stack getStack()
        Get the stack. This method is only used internally by DefaultSymbolTable.
        Specified by:
        getStack in interface SymbolTable
        Returns:
        the stack