createInterface
Create a Java object that implements the specified Java interface using the given Mathnium function or functions.
(object)=createInterface(functions, interface)
Inputs
functions A function (for an interface with only one method) or an array of name-function pairs. The name in each pair should be the name of a method in the interface, and the function should be the function that corresponds to the method.
interface A Java interface in the current class path.
Outputs
object A java object that implements the interface using the given functions.


Description
For an interface with a single method, the first input may just be a function object.

If a method of a Java object requires an interface as an input, using a Mathnium function object as the input creates the requisite interface transparently if such a construction is possible and no explicit call to createInterface is required.
Example
>>import java.awt.event.*
>>function action(e);end
>>listener=createInterface(@action,ActionListener)
>>ActionListener.class.isInstance(listener)
         1
>>listener1=createInterface({"actionPerformed",@action},ActionListener)
>>ActionListener.class.isInstance(listener1)
         1
>>import javax.swing.*
>>b=new JButton("OK");
>>// No explicit call to 'createInterface' is needed here.
>>b.addActionListener(@action)