remove()

The system function JavaLib.remove removes the specified identifier from the EGL Java™ object space. The object related to the identifier is also removed, but only if the identifier is the only one that refers to the object. If another identifier refers to the object, the object remains in the object space and is accessible by way of that other identifier.

JavaLib.remove is one of several Java access functions.

  JavaLib.remove(identifier javaObjId in)
identifier
The identifier that refers to an object. No error occurs if the identifier is not found.

This argument is either a string literal or a variable of type CHAR, DBCHAR, MBCHAR, STRING, or UNICODE. The identifier must be 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, which is case sensitive.

An example is as follows:
  JavaLib.remove( (objId)myStoredObject );

No runtime errors are associated with JavaLib.remove.

Note: By invoking the system functions JavaLib.remove and JavaLib.removeAll, your code allows the Java Virtual Machine to handle garbage collection in the EGL Java object space. If you do not invoke an 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.

Related concepts

Related tasks
Syntax diagram for EGL statements and commands

Related reference
EGL library JavaLib

getField()
invoke()
isNull()
isObjID()
qualifiedTypeName()
removeAll()
setField()
store()
storeCopy()
storeField()
storeNew()

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.