Package com.singularsys.jep.misc

# Class CaseInsensitiveVariableTable

java.lang.Object
com.singularsys.jep.VariableTable
com.singularsys.jep.misc.DecoratingVariableTable
com.singularsys.jep.misc.CaseInsensitiveVariableTable

All Implemented Interfaces:
  `JepComponent`, `Serializable`

public class CaseInsensitiveVariableTable extends DecoratingVariableTable
A Variable table which ignores case. Internally variable names are converted to lowercase.

Author:
  Richard Morris
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.VariableTable

  `table, vf`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CaseInsensitiveVariableTable()`
  `CaseInsensitiveVariableTable(VariableTable tbl)`
  Copy constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Variable`
  `addConstant(String name, Object value)`
  Adds a new constant
  `Variable`
  `addVariable(String name)`
  Adds a new variable with no value specified.
  `Variable`
  `addVariable(String name, Object value)`
  Adds a new variable with specified value.
  `static CaseInsensitiveVariableTable`
  `decoratorInstance(VariableTable tbl)`
  Create a decorator instance
  `JepComponent`
  `getLightWeightInstance()`
  Returns a new empty VariableTable.
  `Variable`
  `getVariable(String name)`
  Gets an existing variable, returns null if variable is not found.
  `Variable`
  `remove(String name)`
  Remove a variable with a given name from the table.

  ### Methods inherited from class com.singularsys.jep.misc.DecoratingVariableTable

  `clear, clearValues, containsKey, containsVariable, copyConstantsFrom, copyVariablesFrom, getBase, getVariableFactory, getVariables, init, isEmpty, keySet, remove, removeNonConstants, setVariableFactory, size, toString, values`

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

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

- ## Constructor Details

  - ### CaseInsensitiveVariableTable

    public CaseInsensitiveVariableTable()

  - ### CaseInsensitiveVariableTable

    public CaseInsensitiveVariableTable(VariableTable tbl)
    Copy constructor
    Parameters:
      `tbl` - table to copy variables from

- ## Method Details

  - ### decoratorInstance

    public static CaseInsensitiveVariableTable decoratorInstance(VariableTable tbl)
    Create a decorator instance
    Parameters:
      `tbl` - the base table
    Returns:
      a new instance

  - ### addVariable

    public Variable addVariable(String name)
    Adds a new variable with no value specified.
    Overrides:
      `addVariable` in class `DecoratingVariableTable`
    Parameters:
      `name` - variable name, will be converted to lower case
    Returns:
      the variable

  - ### addConstant

    public Variable addConstant(String name, Object value) throws JepException
    Adds a new constant
    Overrides:
      `addConstant` in class `DecoratingVariableTable`
    Parameters:
      `name` - variable name, will be converted to lower case
      `value` - variable value
    Returns:
      the variable
    Throws:
      `JepException` - if an attempt is made to set the value of an existing constant variable

  - ### addVariable

    public Variable addVariable(String name, Object value) throws JepException
    Adds a new variable with specified value.
    Overrides:
      `addVariable` in class `DecoratingVariableTable`
    Parameters:
      `name` - variable name, will be converted to lower case
      `value` - initial value
    Returns:
      the variable
    Throws:
      `JepException` - if an attempt is made to set the value of a constant variable

  - ### getVariable

    public Variable getVariable(String name)
    Gets an existing variable, returns null if variable is not found.
    Overrides:
      `getVariable` in class `DecoratingVariableTable`
    Parameters:
      `name` - variable name, will be converted to lower case
    Returns:
      the variable

  - ### remove

    public Variable remove(String name)
    Description copied from class: `VariableTable`
    Remove a variable with a given name from the table.
    Overrides:
      `remove` in class `DecoratingVariableTable`
    Parameters:
      `name` - name of the variable to remove
    Returns:
      the removed variable or null if the variable does not exist in the table.

  - ### getLightWeightInstance

    public JepComponent getLightWeightInstance()
    Description copied from class: `VariableTable`
    Returns a new empty VariableTable.
    Specified by:
      `getLightWeightInstance` in interface `JepComponent`
    Overrides:
      `getLightWeightInstance` in class `DecoratingVariableTable`
    Returns:
      a new VariableTable
    See Also:
      - `VariableTable.copyConstantsFrom(VariableTable)`
      - `VariableTable.copyVariablesFrom(VariableTable)`