NotEmptyList

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

Representation of lists that contain at least one element.

Parameters

E

The type of elements contained in this list.

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
abstract infix operator fun get(index: Int): E
@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.

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.

indexOf
Link copied to clipboard
common
abstract fun indexOf(element: E): Int
isEmpty
Link copied to clipboard
common
abstract fun isEmpty(): Boolean
iterator
Link copied to clipboard
common
abstract operator override fun iterator(): Iterator<E>
lastIndexOf
Link copied to clipboard
common
abstract fun lastIndexOf(element: E): Int
listIterator
Link copied to clipboard
common
abstract fun listIterator(): ListIterator<E>
abstract fun listIterator(index: Int): ListIterator<E>
subList
Link copied to clipboard
common
abstract fun subList(fromIndex: Int, toIndex: Int): List<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.