Set
Set:
object
Defined in: src/immutable/ImmutableCollections.ts:781
Unmodifiable sets: null elements and null queries rejected, value equality with any Set; iteration order is unspecified.
Type Declaration
Section titled “Type Declaration”copyOf()
Section titled “copyOf()”copyOf<
E>(c):Set<E>
Returns an unmodifiable set of the elements of c; duplicates are dropped and iteration order is unspecified.
Returns c itself when it already is a set made by Set.of or Set.copyOf.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”Collection<E>
Returns
Section titled “Returns”Set<E>
Throws
Section titled “Throws”NullPointerException if c is null or contains a null or undefined element
of<
E>(…elements):Set<E>
Returns an unmodifiable set of the arguments. Iteration order is unspecified.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”elements
Section titled “elements”…E[]
Returns
Section titled “Returns”Set<E>
Throws
Section titled “Throws”IllegalArgumentException on a duplicate element
Throws
Section titled “Throws”NullPointerException if an element is null or undefined
ofLazy()
Section titled “ofLazy()”ofLazy<
E>(elementCandidates,computingFunction):Set<E>
preview. Unmodifiable set whose members are the elementCandidates for which computingFunction returns true, each status computed on first access (contains, iteration, size) and at most once. Failures behave as in List.ofLazy. Later changes to elementCandidates are not seen. contains(null) throws NullPointerException; a non-candidate is never a member.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”elementCandidates
Section titled “elementCandidates”Set<E>
computingFunction
Section titled “computingFunction”(e) => boolean
Returns
Section titled “Returns”Set<E>
Throws
Section titled “Throws”NullPointerException if elementCandidates, one of them, or computingFunction is null