new EFunHandler() {
@Override
public EObject invoke(EProc proc, EObject[] args)
throws Pausable {
if (proc != owner)
throw new ErlangError(ERT.am_badfun, args);
r.run();
return ERT.am_ok;
}
}, getClass().getClassLoader());
}
/*
* a java.util.Map can be used as a function with 1 argument to get a
* value
*/
if ((nargs == 1) && (real_object instanceof java.util.Map<?, ?>)) {
final java.util.Map<?, ?> r = (java.util.Map<?, ?>) real_object;
return EFunCG.get_fun_with_handler("java.util.Map", "get", 0,
new EFunHandler() {
@Override
public EObject invoke(EProc self, EObject[] args)
throws Pausable {
if (self != owner)
throw new ErlangError(ERT.am_badfun, args);
Object key = JavaObject.unbox(self, Object.class, args[0]);
if (r.containsKey(key)) {
return new ETuple2(args[0], JavaObject.box(self, r
.get(key)));