BlogGitHub
Reference/ORK/CORE/ORK/IF_WEAK_MAP
Interface/ORK/IF_WEAK_MAP
WeakMap<string, object>
Package
/ORK/CORE
Members
7
Description

This interface defines a WeakMap<string, object>. It allows storing and retrieving objects using a string key. Internally, objects are weakly referenced (using cl_abap_weak_reference) and may be garbage collected if no strong references exist elsewhere in the system.

6 items
Methods
get
MethodPublic
Retrieves an object for the specified key.

Returns NULL if no mapping exists or if the object has been garbage collected.

Parameters

NameDescriptionkey

The string key associated with the object.

result

The referenced object, or NULL if not available.

Signature

METHODS get IMPORTING !key TYPE string
              RETURNING VALUE(result) TYPE REF TO object.
set
MethodPublic
Associates the specified object with the given key.

If a mapping for the key already exists, it will be overwritten.

Parameters

NameDescriptionkey

The string key to associate with the object.

obj

The object reference to store (may be NULL).

Signature

METHODS set IMPORTING !key TYPE string
                        obj TYPE REF TO object.
remove
MethodPublic
Removes the mapping for the specified key, if it exists.

Returns true if a mapping was removed, false otherwise.

Parameters

NameDescriptionkey

The string key of the mapping to remove.

result

true if removal was successful, false otherwise.

Signature

METHODS remove IMPORTING !key TYPE string
                 RETURNING VALUE(result) TYPE abap_bool.
keys
MethodPublic
Returns all keys of the mapping

Parameters

NameDescriptionresult

Keys

Signature

METHODS keys RETURNING VALUE(result) TYPE REF TO /ork/if_hs_string_r.
clear
MethodPublic
Removes all mappings

Signature

METHODS clear.
clean_up
MethodPublic
Removes mappings of garbage collected objects

Signature

METHODS clean_up.
1 item
Types
ty_s_alive_map
TypePublic

Signature

TYPES: BEGIN OF ty_s_alive_map,
           key TYPE string,
           obj TYPE REF TO object,
         END OF ty_s_alive_map.
Repository11 packages · 113 objects
124 items