Class FunctionTable

    • Constructor Detail

      • FunctionTable

        public FunctionTable()
        Constructor with an empty map.
      • FunctionTable

        protected FunctionTable​(java.util.Map<java.lang.String,​PostfixMathCommandI> oldMap)
        Constructor with a prespecified map. Subclasses should define similar constructors to allow the shallowCopy() to work.
        Parameters:
        oldMap - map with existing set of functions
        Since:
        4.0
    • Method Detail

      • init

        public void init​(Jep jep)
        Description copied from interface: JepComponent
        Initialize the component. This methods is called whenever a component is added to Jep. Hence it allows components to keep track of the other components they may rely on.
        Specified by:
        init in interface JepComponent
        Parameters:
        jep - the current Jep instance
      • clear

        public void clear()
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​PostfixMathCommandI>> entrySet()
      • isEmpty

        public boolean isEmpty()
      • keySet

        public java.util.Set<java.lang.String> keySet()
      • size

        public int size()
      • containsKey

        public boolean containsKey​(java.lang.String key)
      • shallowCopy

        public FunctionTable shallowCopy()
        Returns a new shallow copy of this function table. Calls the threadSafeMapCopy() method to ensure the table is safe to use a separate thread. All sub-classes should override this methods to create a function table of the matching type. A typical implementation would be
                  @Override
                  public FunctionTable shallowCopy() {
                      Map<String,PostfixMathCommandI> newMap = this.threadSafeMapCopy();
                return new myFunctionTable(newMap);
                  }
         
        using the threadSafeMapCopy() method to return a copy of the map of operators and a constructor taking this map which uses the FunctionTable(Map) constructor.
        Returns:
        a new shallow copy of this function table
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object