Class ExternalSymbolMapBase

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ExternalSymbolMapBase​(boolean assumeSymbolsRequireExternalSymbolMapArgument)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract ISymbol getSymbol​(java.lang.String name)  
      java.lang.Object getValue​(java.lang.String name)
      Returns the value for the symbol with the given name.
      java.lang.Object getValue​(java.lang.String name, int iArrayDims)
      Called via bytecode.
      java.lang.Object invoke​(java.lang.String name, java.lang.Object[] args)
      Invokes the named external function with the given arguments.
      private boolean isCapturedSymbol​(int iArrayDims, java.lang.Object value, java.lang.Class valueClass)  
      void setValue​(java.lang.String name, java.lang.Object value)
      Sets the value of the symbol with the given name.
      protected boolean shouldAddInExternalSymbolMapArgumentForFunctionSymbol​(IFunctionSymbol symbol)  
      protected void verifySymbol​(java.lang.String name, ISymbol symbol)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _assumeSymbolsRequireExternalSymbolMapArgument

        private boolean _assumeSymbolsRequireExternalSymbolMapArgument
    • Constructor Detail

      • ExternalSymbolMapBase

        protected ExternalSymbolMapBase​(boolean assumeSymbolsRequireExternalSymbolMapArgument)
    • Method Detail

      • getValue

        public java.lang.Object getValue​(java.lang.String name)
        Description copied from interface: IExternalSymbolMap
        Returns the value for the symbol with the given name. Throws a runtime exception if the name does not correspond to a valid external symbol.
        Specified by:
        getValue in interface IExternalSymbolMap
        Parameters:
        name - the name of the symbol
        Returns:
        the current value of the symbol
      • getValue

        public java.lang.Object getValue​(java.lang.String name,
                                         int iArrayDims)
        Description copied from interface: IExternalSymbolMap
        Called via bytecode.
        Specified by:
        getValue in interface IExternalSymbolMap
        iArrayDims - the expected number of array dimensions of the the symbol's type, useful for debugger expr evaluation for dynamically unwrapping type a single elem array (a captured var)
        Returns:
      • isCapturedSymbol

        private boolean isCapturedSymbol​(int iArrayDims,
                                         java.lang.Object value,
                                         java.lang.Class valueClass)
      • setValue

        public void setValue​(java.lang.String name,
                             java.lang.Object value)
        Description copied from interface: IExternalSymbolMap
        Sets the value of the symbol with the given name. Throws a runtime exception if the name does not correspond to a valid external symbol.
        Specified by:
        setValue in interface IExternalSymbolMap
        Parameters:
        name - the name of the symbol
        value - the new value to give that symbol
      • invoke

        public java.lang.Object invoke​(java.lang.String name,
                                       java.lang.Object[] args)
        Description copied from interface: IExternalSymbolMap
        Invokes the named external function with the given arguments. The name argument should correspond to the result of calling getName() on the external function symbol.
        Specified by:
        invoke in interface IExternalSymbolMap
        Parameters:
        name - the name of the function symbol
        args - the arguments to the method
        Returns:
        the result of the function invocation
      • shouldAddInExternalSymbolMapArgumentForFunctionSymbol

        protected boolean shouldAddInExternalSymbolMapArgumentForFunctionSymbol​(IFunctionSymbol symbol)
      • verifySymbol

        protected void verifySymbol​(java.lang.String name,
                                    ISymbol symbol)
      • getSymbol

        protected abstract ISymbol getSymbol​(java.lang.String name)