edu.vub.at.objects.symbiosis
Interface JavaClosure


 JavaClosure

The public interface to a closure pairing a Java wrapper object with a symbiotic Java method.

Author:
tvcutsem

Method Summary
 Closure cast(Object[] types)
          Using this method, AmbientTalk symbiotic code is able to perform manual overloaded method disambiguation.
 
Methods inherited from interface edu.vub.at.objects.Closure
apply, applyInScope, context, escape, method, whileTrue:
 
Methods inherited from interface edu.vub.at.objects.Object
super
 

Method Detail

cast

Closure cast(Object[] types)
Using this method, AmbientTalk symbiotic code is able to perform manual overloaded method disambiguation. When evaluating javaObject.methodName, the result is a java closure wrapping all of the overloaded methods whose name corresponds to methodName. Sometimes, the symbiosis layer is not able to disambiguate methods simply by means of the types of the actual arguments. In that case, this 'cast' method can be used to manually disambiguate methods as follows: jObject.methodName.cast(JClass1, JClass2)(arg1, arg2). jObject.methodName.cast(JClass1, JClass2) evaluates to a java closure that only contains those overloaded methods whose parameter types exactly match the ones given.

Parameters:
types - an array of JavaClass objects
Returns:
a new JavaClosure where the wrapped overloaded methods correspond to the given types
Throws:
edu.vub.at.exceptions.XSymbiosisFailure - when no wrapped methods correspond to the given types