LinkedHashSet

open actual class LinkedHashSet<E> : 
    HashSet<E>,
    MutableSet<E>
(source)

Platform and version requirements: JS

The implementation of the MutableSet interface, backed by a LinkedHashMap instance.

This implementation preserves the insertion order of elements during the iteration.

Constructors

<init>

LinkedHashSet()
LinkedHashSet(initialCapacity: Int, loadFactor: Float = 0.0f)

Constructs a new empty LinkedHashSet.

LinkedHashSet(elements: Collection<E>)

Constructs a new LinkedHashSet filled with the elements of the specified collection.

LinkedHashSet(initialCapacity: Int)

Inherited Properties

size

open actual val size: Int

Returns the size of the collection.

Inherited Functions

add

open actual fun add(element: E): Boolean

Adds the specified element to the collection.

HashSet

fun addAll(elements: Collection<E>): Boolean

Adds all of the elements in the specified collection to this collection.

fun containsAll(elements: Collection<E>): Boolean

Checks if all elements in the specified collection are contained in this collection.

fun removeAll(elements: Collection<E>): Boolean

Removes all of this collection's elements that are also contained in the specified collection.

fun retainAll(elements: Collection<E>): Boolean

Retains only the elements in this collection that are contained in the specified collection.

clear

open actual fun clear()

Removes all elements from this collection.

contains

open operator actual fun contains(element: E): Boolean

Checks if the specified element is contained in this collection.

isEmpty

open actual fun isEmpty(): Boolean

Returns true if the collection is empty (contains no elements), false otherwise.

iterator

open actual fun iterator(): MutableIterator<E>

Returns an iterator over the elements of this object.

remove

open actual fun remove(element: E): Boolean

Removes a single instance of the specified element from this collection, if it is present.