User Tools

Site Tools


at:tutorial:appendix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:appendix [2008/07/10 17:27] – added tvcutsemat:tutorial:appendix [2008/07/10 17:33] – added tvcutsem
Line 617: Line 617:
  
 ==== Object Inspector ==== ==== Object Inspector ====
 +
 +The module ''/.at.support.inspector'' implements a graphical object inspector. The module requires ''java.awt'' and ''javax.swing'' support from the underlying JVM running AmbientTalk. To inspect an object ''o'', execute:
 +
 +<code>
 +import /.at.support.inspector;
 +inspect(o);
 +</code>
 +
 +This will pop up a graphical inspector on the object, listing the object's fields and methods. The object's fields and methods can recursively be inspected through the graphical user interface of the object inspector.
  
 ==== Symbiosis Utilities ==== ==== Symbiosis Utilities ====
 +
 +The module ''/.at.support.symbiosis'' defines a number of utility functions with respect to the symbiosis with the JVM. It defines the following functions which can be used to quickly create a wrapped Java value of the given primitive type:
 +
 +<code>
 +long(anAmbientTalkNumber) -> aJavaLong
 +short(anAmbientTalkNumber) -> aJavaShort
 +float(anAmbientTalkFraction) -> aJavaFloat
 +byte(anAmbientTalkNumber) -> aJavaByte
 +</code>
 +
 +The module also defines the following function:
 +<code>
 +cast: obj into: Interface
 +</code>
 +
 +The ''Interface'' argument should be a Java class wrapper for an interface type. The function returns a Java proxy object implementing the given interface, wrapping the given AmbientTalk object. If this proxy is subsequently passed to Java code, it will hold that ''proxy instanceof Interface''.
  
 ==== Miscellaneous ==== ==== Miscellaneous ====
at/tutorial/appendix.txt · Last modified: 2021/09/24 10:28 by elisag