List
List:
object
Defined in: src/immutable/ImmutableCollections.ts:776
Unmodifiable lists: random access, null elements and null queries rejected, value equality with any List.
Type Declaration
Section titled “Type Declaration”copyOf()
Section titled “copyOf()”copyOf<
E>(c):List<E>
Returns an unmodifiable list of the elements of c, in its iteration order. Returns c itself when it
already is a list made by List.of or List.copyOf.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”Collection<E>
Returns
Section titled “Returns”List<E>
Throws
Section titled “Throws”NullPointerException if c is null or contains a null or undefined element
of<
E>(…elements):List<E>
Returns an unmodifiable list of the arguments, in argument order.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”elements
Section titled “elements”…E[]
Returns
Section titled “Returns”List<E>
Throws
Section titled “Throws”NullPointerException if an element is null or undefined
ofLazy()
Section titled “ofLazy()”ofLazy<
E>(size,computingFunction):List<E>
preview. Unmodifiable random-access list of size elements, each computed by
computingFunction(index) on first access and at most once. A throwing function, a null/undefined
result or a recursive access for the same index throws NoSuchElementException (with the failure as
cause); that index then stays failed and throws NoSuchElementException without calling the function
again. subList/reversed views are lazy too; equals/hashCode/toString compute elements.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”number
computingFunction
Section titled “computingFunction”(index) => E
Returns
Section titled “Returns”List<E>
Throws
Section titled “Throws”IllegalArgumentException if size is negative or not an integer
Throws
Section titled “Throws”NullPointerException if computingFunction is null