addFirst

open fun addFirst(e: E)

Adds an element as the first element of this collection (optional operation). After this operation completes normally, the given element will be a member of this collection, and it will be the first element in encounter order.

Parameters

e

the element to be added

Throws

if the specified element is null and this collection does not permit null elements

if this collection implementation does not support this operation