Identity Set
The IdentitySet utilizes an IdentityHashMap internally to act as a Set. It overrides the methods of MutableSet to provide set-like behavior but uses reference equality (===
) for comparisons instead of object equality (==
). This means the set checks if objects are the same instance in memory rather than having the same content.
This can be useful in scenarios where you want to ensure you only have unique object instances in the set, regardless of their content. For example, if you are working with objects that have unique identifiers but might have mutable properties, using an IdentitySet can help ensure you don't accidentally add duplicate object instances with the same identifier.
Functions
Adds multiple elements to the set.
Compares multiple elements.
Returns the iterator for the set.
Calculates a bounding box that encompasses the geo locations of all images in the collection.
Removes multiple elements from the set.
This method modifies the set by retaining only the elements that are present in both the set and the specified collection. Elements that are not in the collection will be removed from the set.
Converts a collection of AdministrativeUnit models into a list of AdministrativeUnitViewData view objects used to represent a list of administrative units in the UI. Each AdministrativeUnit is converted to an AdministrativeUnitViewData object using its toAdministrativeUnitViewData
method, which likely extracts relevant data for UI display.
Converts a collection of Image models into a list of ImageViewData view objects used to represent a list of images in the UI. Each Image is converted to an ImageViewData object using its toViewData
method, which likely extracts relevant data for UI display.