nelson.lang.HandlePlaceholder
Placeholder handle class used for missing handle targets.
📝Syntax
obj = nelson.lang.HandlePlaceholder()
📤Output Arguments
Parameter Description
obj a scalar handle object.
📄Description

nelson.lang.HandlePlaceholder is a concrete handle class used when an API must return a handle object but no live target is available.

A placeholder object created with the constructor is a normal valid handle until it is deleted.

Weak references with no assigned target return an invalid handle whose class is nelson.lang.HandlePlaceholder.

The class does not define user properties or methods beyond the common handle operations.

Use this class as a neutral handle class when the original target class is unknown or not relevant.

A constructed placeholder object and an invalid placeholder handle are different values. The constructed object is valid until deleted; an invalid placeholder handle is never valid.

Placeholder handles can be checked with isvalid, compared by class name with class, and used anywhere a generic handle placeholder is appropriate.

The class is intentionally empty. It is not a container for user data.

💡Examples
Create and delete a placeholder handle.
p = nelson.lang.HandlePlaceholder();
class(p)
isvalid(p)
delete(p)
isvalid(p)
Inspect the default handle returned by an empty weak reference.
w = nelson.lang.WeakReference();
h = w.Handle;
class(h)
isvalid(h)
Compare a valid placeholder object with an invalid placeholder handle.
p = nelson.lang.HandlePlaceholder();
q = nelson.lang.invalidHandle('nelson.lang.HandlePlaceholder');
class(p)
class(q)
isvalid(p)
isvalid(q)
🔗See Also
nelson.lang.WeakReferencenelson.lang.invalidHandleisvalidclass
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub