NotEmptySet

@SinceKotools(project = Project.Types, version = "1.3")
interface NotEmptySet<out E> : NotEmptyCollection<E> , Set<E>

Representation of sets that contain at least one element.

Parameters

E

The type of elements contained in this set.

Functions

contains
Link copied to clipboard
common
abstract operator fun contains(element: E): Boolean
containsAll
Link copied to clipboard
common
abstract fun containsAll(elements: Collection<E>): Boolean
get
Link copied to clipboard
common
@SinceKotools(project = Project.Types, version = "1.3")
open operator fun get(index: PositiveInt): E

Returns the element at the specified index in this collection, or throws an IndexOutOfBoundsException if the index is out of bounds.

open infix operator override fun get(index: Int): E

Returns the element at the specified index in this collection, or throws an IndexOutOfBoundsException if the index is out of bounds.

getOrNull
Link copied to clipboard
common
open infix fun getOrNull(index: Int): E?
@SinceKotools(project = Project.Types, version = "1.3")
open infix fun getOrNull(index: PositiveInt): E?

Returns the element at the specified index in this collection, or returns null if the index is out of bounds.

isEmpty
Link copied to clipboard
common
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
common
abstract operator override fun iterator(): Iterator<E>
toNotBlankString
Link copied to clipboard
common
open fun toNotBlankString(): NotBlankString

Returns the string representation of this collection as a NotBlankString.

Properties

head
Link copied to clipboard
common
abstract val head: E

First element of this collection.

size
Link copied to clipboard
common
abstract val size: Int
typedSize
Link copied to clipboard
common
open val typedSize: StrictlyPositiveInt

Returns the size of this collection as a StrictlyPositiveInt.