LinkedHashSet

actual typealias LinkedHashSet<E> = LinkedHashSet<E> (source)

Platform and version requirements: Kotlin 1.1, JVM

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.

val size: Int (source)

Overrides Set.size

Overrides Collection.size

Returns the size of the collection.

fun isEmpty(): Boolean (source)

Overrides Set.isEmpty

Overrides Collection.isEmpty

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

fun contains(element: @UnsafeVariance E): Boolean (source)

Overrides Set.contains

Overrides Collection.contains

Checks if the specified element is contained in this collection.

fun containsAll(
    elements: Collection<@UnsafeVariance E>
): Boolean
(source)

Overrides Set.containsAll

Overrides Collection.containsAll

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

fun iterator(): MutableIterator<E> (source)

Overrides MutableSet.iterator

Returns an iterator over the elements of this object.

fun add(element: E): Boolean (source)

Overrides MutableSet.add

Adds the specified element to the collection.

Return true if the element has been added, false if the collection does not support duplicates and the element is already contained in the collection.

fun remove(element: E): Boolean (source)

Overrides MutableSet.remove

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

Return true if the element has been successfully removed; false if it was not present in the collection.

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

Overrides MutableSet.addAll

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

Return true if any of the specified elements was added to the collection, false if the collection was not modified.

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

Overrides MutableSet.removeAll

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

Return true if any of the specified elements was removed from the collection, false if the collection was not modified.

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

Overrides MutableSet.retainAll

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

Return true if any element was removed from the collection, false if the collection was not modified.

fun clear() (source)

Overrides MutableSet.clear

Removes all elements from this collection.