remove()

The javaLib.remove() system function removes the specified identifier from the EGL Java™ object space. The object related to the identifier is also removed, but only if no other identifier refers to the object. If another identifier refers to the object, the object remains in the object space and is accessible through the other identifier.

By invoking the javaLib.remove() or javaLib.removeAll() system functions, your code allows the Java Virtual Machine to perform garbage collection in the EGL Java object space. If you do not invoke a system function to remove an object from the object space, the memory is not recovered during the run time of any program that has access to the object space.

For more about the EGL Java object space in which javaLib.remove() and similar functions operate, see Java access functions. EGL maintains this method of Java access for compatibility with earlier versions. For new code, use the more powerful ExternalType syntax; for more information, see ExternalType part.

Syntax

  javaLib.remove(identifier javaObjId in)
identifier
The case-sensitive identifier that refers to an object. Input can be any variable or expression that is assignment compatible with the STRING type, and is cast to objID, as shown in a later example. EGL strips single- and double-byte blanks from the beginning and end of the argument value. No error occurs if the identifier is not found.

Example

In the following example, the function removes myStoredObject (cast as objID) from the object space.

  javaLib.remove(myStoredObject as "objID:java");

Feedback