Package uk.me.nxg.unity

# Class FunctionDefinitionMap

java.lang.Object
uk.me.nxg.unity.FunctionDefinitionMap

public abstract class FunctionDefinitionMap extends Object
Provides a mapping from function abbreviations to function definitions.

This is a singleton class, so clients must first obtain the instance of the class using `getInstance()`.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`FunctionDefinitionMap()`
Constructs a new function-definition map.

## Method Summary

Modifier and Type
Method
Description
`static FunctionDefinitionMap`
`getInstance()`
Obtain an instance of the function-definition map.
`static FunctionDefinition`
`lookupFunctionDefinition(Syntax syntax, String functionName)`
Return the FunctionDefinition corresponding to a name, in a particular syntax.
`static String`
`lookupFunctionName(Syntax syntax, FunctionDefinition fd)`
Return the name corresponding to a function definition in a particular syntax.

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

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

## Constructor Details

### FunctionDefinitionMap

protected FunctionDefinitionMap()
Constructs a new function-definition map. This is protected on purpose – instances should be retrieved using the `getInstance()` method.

## Method Details

### getInstance

public static FunctionDefinitionMap getInstance()
Obtain an instance of the function-definition map.

Returns:
  the singleton instance of this class

### lookupFunctionDefinition

public static FunctionDefinition lookupFunctionDefinition(Syntax syntax, String functionName)
Return the FunctionDefinition corresponding to a name, in a particular syntax. Returns null if the function is not known in this syntax.

Parameters:
  `syntax` - one of the syntaxes of `Syntax`
  `functionName` - the name of the function (eg "log") to be looked up
Returns:
  a function definition

### lookupFunctionName

public static String lookupFunctionName(Syntax syntax, FunctionDefinition fd)
Return the name corresponding to a function definition in a particular syntax. The 'name' is the name of the function for display, for example `log` for Logarithm, and this is in principle syntax-specific (though in fact there is no variation between syntaxes).

Parameters:
  `syntax` - we look up functions known in only this syntax
  `fd` - the definition of the function, which we want the name of
Returns:
  the name of a function, for display