-2

我想将以下 Java 代码转换为 Jython 代码。我对Java不太了解。

String name = connection.runReadAction(new ReadActionResult<String>()
{
     public String execute(SystemAccess access) throws Exception
     {
        return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName();
     }
 });

你能帮我完成这个任务吗?

4

1 回答 1

1
def execute(access):
  return access.getTree(SystemTree.Geographic).resolve(path).getDisplayName()

name = connection.runReadAction(readActionResult=execute)

Jython 处理创建匿名内部类的混乱细节。

于 2012-09-27T18:24:57.827 回答