IdentitySet

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.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val size: Int

Returns the size of the set.

Functions

Link copied to clipboard
open override fun add(element: T): Boolean

Adds an element to the set.

Link copied to clipboard
open override fun addAll(elements: Collection<T>): Boolean

Adds multiple elements to the set.

Link copied to clipboard
open override fun clear()

Clears the set.

Link copied to clipboard
open operator override fun contains(element: T): Boolean

Checks if there's a element.

Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean

Compares multiple elements.

Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
Link copied to clipboard
open override fun isEmpty(): Boolean

Check if the set is empty.

Link copied to clipboard
open operator override fun iterator(): MutableIterator<T>

Returns the iterator for the set.

Link copied to clipboard

Calculates a bounding box that encompasses the geo locations of all images in the collection.

Link copied to clipboard
open fun parallelStream(): Stream<T>
Link copied to clipboard
open override fun remove(element: T): Boolean

Removes an element from the set.

Link copied to clipboard
open override fun removeAll(elements: Collection<T>): Boolean

Removes multiple elements from the set.

Link copied to clipboard
open fun removeIf(p0: Predicate<in T>): Boolean
Link copied to clipboard
open override fun retainAll(elements: Collection<T>): Boolean

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.

Link copied to clipboard
open override fun spliterator(): Spliterator<T>
Link copied to clipboard
open fun stream(): Stream<T>
Link copied to clipboard

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.

Link copied to clipboard

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.