com.singularsys.jep

## Class FunctionTable

- java.lang.Object
- - com.singularsys.jep.FunctionTable

- All Implemented Interfaces:
    JepComponent, java.io.Serializable
  Direct Known Subclasses:
    BigDecFunctionTable, CaseInsensitiveFunctionTable, NullWrappedFunctionTable, RealFunctionTable, StandardFunctionTable

      public class FunctionTable
      extends java.lang.Object
      implements JepComponent

  A table holding details of the functions known to Jep. This class has no functions loaded.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,PostfixMathCommandI>` | `table`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionTable()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PostfixMathCommandI` | `addFunction(java.lang.String name, PostfixMathCommandI pfmc)`
    `void` | `clear()`
    `boolean` | `containsKey(java.lang.String key)`
    `boolean` | `containsValue(PostfixMathCommandI value)`
    `java.util.Set<java.util.Map.Entry<java.lang.String,PostfixMathCommandI>>` | `entrySet()`
    `PostfixMathCommandI` | `getFunction(java.lang.String name)`
    `JepComponent` | `getLightWeightInstance()` Return a function table with the same set of functions as this one.
    `void` | `init(Jep jep)` Initialize the component.
    `boolean` | `isEmpty()`
    `java.util.Set<java.lang.String>` | `keySet()`
    `PostfixMathCommandI` | `remove(java.lang.String key)`
    `FunctionTable` | `shallowCopy()` Returns a new shallow copy of this function table.
    `int` | `size()`
    `java.lang.String` | `toString()`
    `java.util.Collection<PostfixMathCommandI>` | `values()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### table

          protected java.util.Map<java.lang.String,PostfixMathCommandI> table

  - ### Constructor Detail

    - #### FunctionTable

          public FunctionTable()

  - ### 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

    - #### getFunction

          public PostfixMathCommandI getFunction(java.lang.String name)

    - #### addFunction

          public PostfixMathCommandI addFunction(java.lang.String name,
                                                 PostfixMathCommandI pfmc)

    - #### 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()

    - #### values

          public java.util.Collection<PostfixMathCommandI> values()

    - #### containsKey

          public boolean containsKey(java.lang.String key)

    - #### containsValue

          public boolean containsValue(PostfixMathCommandI value)

    - #### remove

          public PostfixMathCommandI remove(java.lang.String key)

    - #### getLightWeightInstance

          public JepComponent getLightWeightInstance()

      Return a function table with the same set of functions as this one. If any of the pfmc's implement the `JepComponent` interface then that functions `JepComponent.getLightWeightInstance()` method will be called to return a thread safe function.
      Specified by:
        `getLightWeightInstance` in interface `JepComponent`
      Returns:
        a new FunctionTable

    - #### shallowCopy

          public FunctionTable shallowCopy()

      Returns a new shallow copy of this function table. The entries in the table refer to the the same instances of the postfix math commands. If sub-classes use pfmc's which are not thread safe they should override this methods and set a new instance for the table.
      Returns:
        a new shallow copy of this function table

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2018 Singular Systems http://www.singularsys.com/jep