JLink`
JLink`
ReturnAsJavaObject
ReturnAsJavaObject[expr]
causes a Java method call or field access during the evaluation of expr to return its result as an object reference (a JavaObject expression), not a value.
更多信息和选项
- To use ReturnAsJavaObject, you first need to load J/Link using Needs["JLink`"].
- Most Java objects are returned as references normally, but those that have a meaningful Wolfram Language representation are returned "by value". Such objects include strings, arrays, and the so-called wrapper classes like java.lang.Integer. ReturnAsJavaObject overrides the normal behavior and forces any object returned to the Wolfram Language to be sent only as a reference.
- Typically used to avoid needlessly sending large arrays of numbers back and forth between Java and the Wolfram Language.
- You can use ReturnAsJavaObject to cause only a reference to be sent, then use the JavaObjectToExpression function at the end if the final value is needed.
Wolfram Research (2007),ReturnAsJavaObject,Wolfram 语言函数,https://reference.wolfram.com/language/JLink/ref/ReturnAsJavaObject.html.
文本
Wolfram Research (2007),ReturnAsJavaObject,Wolfram 语言函数,https://reference.wolfram.com/language/JLink/ref/ReturnAsJavaObject.html.
CMS
Wolfram 语言. 2007. "ReturnAsJavaObject." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/JLink/ref/ReturnAsJavaObject.html.
APA
Wolfram 语言. (2007). ReturnAsJavaObject. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/JLink/ref/ReturnAsJavaObject.html 年