org.rubato.logeo.functions
Class CompositeFunction

java.lang.Object
  extended by org.rubato.logeo.functions.AbstractFunction
      extended by org.rubato.logeo.functions.CompositeFunction
All Implemented Interfaces:
Function

public class CompositeFunction
extends AbstractFunction

A function that is the composition of two functions.

Author:
Gérard Milmeister

Constructor Summary
CompositeFunction(Function f, Function g)
          Creates a composed function h from f and g, i.e., h(x) = f(g(x)).
CompositeFunction(Function f, Function[] g)
          Creates a composed function h from f and a list g.
 
Method Summary
 Denotator evaluate(Denotator... denotators)
          Evaluates the function with a list of arguments.
 int getArity()
          Returns the arity of the function.
 Form getInputForm(int i)
          Returns the ith argument form.
 java.lang.String getName()
          Returns the name of the function.
 Form getOutputForm()
          Returns the result form.
 
Methods inherited from class org.rubato.logeo.functions.AbstractFunction
compose, hasSig, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeFunction

public CompositeFunction(Function f,
                         Function g)
Creates a composed function h from f and g, i.e., h(x) = f(g(x)).


CompositeFunction

public CompositeFunction(Function f,
                         Function[] g)
                  throws RubatoException
Creates a composed function h from f and a list g. I.e. h(x) = f(g1(x),...,gn(x)).

Parameters:
g - must be of length > 0
Throws:
RubatoException
Method Detail

evaluate

public Denotator evaluate(Denotator... denotators)
                   throws RubatoException
Evaluates the function with a list of arguments. The function must have arity equal to the length of the list.

Specified by:
evaluate in interface Function
Specified by:
evaluate in class AbstractFunction
Throws:
RubatoException

getArity

public int getArity()
Returns the arity of the function.

Specified by:
getArity in interface Function
Specified by:
getArity in class AbstractFunction

getName

public java.lang.String getName()
Returns the name of the function.

Specified by:
getName in interface Function
Overrides:
getName in class AbstractFunction
Returns:
"anonymous" by default.

getInputForm

public Form getInputForm(int i)
Returns the ith argument form.

Specified by:
getInputForm in interface Function
Specified by:
getInputForm in class AbstractFunction
Returns:
null if the input form is not specified

getOutputForm

public Form getOutputForm()
Returns the result form.

Specified by:
getOutputForm in interface Function
Specified by:
getOutputForm in class AbstractFunction
Returns:
null if the output form is not specified