edu.vub.at.objects.symbiosis
Interface ATJavaClosure

All Superinterfaces:
ATClosure, ATConversions, ATObject
All Known Implementing Classes:
JavaClosure

public interface ATJavaClosure
extends ATClosure

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

Author:
tvcutsem

Method Summary
 ATClosure base_cast(ATObject[] types)
          Using this method, AmbientTalk symbiotic code is able to perform manual overloaded method disambiguation.
 
Methods inherited from interface edu.vub.at.objects.ATClosure
base_apply, base_applyInScope, base_escape, base_getContext, base_getMethod, base_whileTrue_
 
Methods inherited from interface edu.vub.at.objects.ATObject
base__opeql__opeql_, base_init, base_new, meta_addField, meta_addMethod, meta_assignField, meta_assignVariable, meta_clone, meta_defineField, meta_doesNotUnderstand, meta_eval, meta_extend, meta_getDynamicParent, meta_getLexicalParent, meta_getStripes, meta_grabField, meta_grabMethod, meta_invoke, meta_isCloneOf, meta_isRelatedTo, meta_isStripedWith, meta_listFields, meta_listMethods, meta_lookup, meta_newInstance, meta_pass, meta_print, meta_quote, meta_receive, meta_resolve, meta_respondsTo, meta_select, meta_send, meta_share
 
Methods inherited from interface edu.vub.at.objects.coercion.ATConversions
asAmbientTalkObject, asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base_asActorMirror, base_asAsyncMessage, base_asBegin, base_asBoolean, base_asClosure, base_asDefinition, base_asExpression, base_asFarReference, base_asField, base_asHandler, base_asMessage, base_asMessageCreation, base_asMethod, base_asMirror, base_asNumber, base_asSplice, base_asStatement, base_asStripe, base_asSymbol, base_asTable, base_asUnquoteSplice, base_asVariableAssignment, base_isBoolean, base_isCallFrame, base_isClosure, base_isFarReference, base_isMessageCreation, base_isMethod, base_isMirror, base_isSplice, base_isStripe, base_isSymbol, base_isTable, base_isUnquoteSplice, base_isVariableAssignment, isAmbientTalkObject, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText
 

Method Detail

base_cast

public ATClosure base_cast(ATObject[] types)
                    throws InterpreterException
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:
XSymbiosisFailure - when no wrapped methods correspond to the given types
InterpreterException