csheets.core.formula.lang
Class Language

java.lang.Object
  extended by csheets.core.formula.lang.Language

public class Language
extends Object

A factory for creating certain types of language elements.

Author:
Einar Pehrson

Method Summary
 BinaryOperator getBinaryOperator(String identifier)
          Returns the binary operator with the given identifier.
 Function getFunction(String identifier)
          Returns the function with the given identifier.
 Function[] getFunctions()
          Returns the functions that are supported by the syntax.
static Language getInstance()
          Returns the singleton instance.
 UnaryOperator getUnaryOperator(String identifier)
          Returns the unary operator with the given identifier.
 boolean hasFunction(String identifier)
          Returns whether there is a function with the given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Language getInstance()
Returns the singleton instance.

Returns:
the singleton instance

getUnaryOperator

public UnaryOperator getUnaryOperator(String identifier)
                               throws UnknownElementException
Returns the unary operator with the given identifier.

Returns:
the unary operator with the given identifier
Throws:
UnknownElementException

getBinaryOperator

public BinaryOperator getBinaryOperator(String identifier)
                                 throws UnknownElementException
Returns the binary operator with the given identifier.

Returns:
the binary operator with the given identifier
Throws:
UnknownElementException

getFunction

public Function getFunction(String identifier)
                     throws UnknownElementException
Returns the function with the given identifier.

Returns:
the function with the given identifier
Throws:
UnknownElementException

hasFunction

public boolean hasFunction(String identifier)
Returns whether there is a function with the given identifier.

Returns:
whether there is a function with the given identifier

getFunctions

public Function[] getFunctions()
Returns the functions that are supported by the syntax.

Returns:
the functions that are supported by the syntax