IntSetKt

Added in 1.4.0

public final class IntSetKt


Summary

Public methods

static final @NonNull IntSet
buildIntSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction
)

Builds a new IntSet by populating a MutableIntSet using the given builderAction.

static final @NonNull IntSet
buildIntSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction
)

Builds a new IntSet by populating a MutableIntSet using the given builderAction.

static final @NonNull IntSet

Returns an empty, read-only IntSet.

static final @NonNull IntSet

Returns an empty, read-only ScatterSet.

static final @NonNull IntSet
intSetOf(int element1)

Returns a new read-only IntSet with only element1 in it.

static final @NonNull IntSet
intSetOf(int elements)

Returns a new read-only IntSet with only elements in it.

static final @NonNull IntSet
intSetOf(int element1, int element2)

Returns a new read-only IntSet with only element1 and element2 in it.

static final @NonNull IntSet
intSetOf(int element1, int element2, int element3)

Returns a new read-only IntSet with only element1, element2, and element3 in it.

static final @NonNull MutableIntSet

Returns a new MutableIntSet.

static final @NonNull MutableIntSet
mutableIntSetOf(int element1)

Returns a new MutableIntSet with only element1 in it.

static final @NonNull MutableIntSet
mutableIntSetOf(int elements)

Returns a new MutableIntSet with the specified elements.

static final @NonNull MutableIntSet
mutableIntSetOf(int element1, int element2)

Returns a new MutableIntSet with only element1 and element2 in it.

static final @NonNull MutableIntSet
mutableIntSetOf(int element1, int element2, int element3)

Returns a new MutableIntSet with only element1, element2, and element3 in it.

Public methods

public static final @NonNull IntSet buildIntSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction
)

Builds a new IntSet by populating a MutableIntSet using the given builderAction.

The set passed as a receiver to the builderAction is valid only inside that function. Using it outside of the function produces an unspecified behavior.

Parameters
@ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction

Lambda in which the MutableIntSet can be populated.

public static final @NonNull IntSet buildIntSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction
)

Builds a new IntSet by populating a MutableIntSet using the given builderAction.

The set passed as a receiver to the builderAction is valid only inside that function. Using it outside of the function produces an unspecified behavior.

Parameters
int initialCapacity

Hint for the expected number of elements added in the builderAction.

@ExtensionFunctionType @NonNull Function1<@NonNull MutableIntSetUnit> builderAction

Lambda in which the MutableIntSet can be populated.

emptyIntSet

public static final @NonNull IntSet emptyIntSet()

Returns an empty, read-only IntSet.

intSetOf

public static final @NonNull IntSet intSetOf()

Returns an empty, read-only ScatterSet.

intSetOf

public static final @NonNull IntSet intSetOf(int element1)

Returns a new read-only IntSet with only element1 in it.

intSetOf

public static final @NonNull IntSet intSetOf(int elements)

Returns a new read-only IntSet with only elements in it.

intSetOf

public static final @NonNull IntSet intSetOf(int element1, int element2)

Returns a new read-only IntSet with only element1 and element2 in it.

intSetOf

public static final @NonNull IntSet intSetOf(int element1, int element2, int element3)

Returns a new read-only IntSet with only element1, element2, and element3 in it.

mutableIntSetOf

public static final @NonNull MutableIntSet mutableIntSetOf()

Returns a new MutableIntSet.

mutableIntSetOf

public static final @NonNull MutableIntSet mutableIntSetOf(int element1)

Returns a new MutableIntSet with only element1 in it.

mutableIntSetOf

public static final @NonNull MutableIntSet mutableIntSetOf(int elements)

Returns a new MutableIntSet with the specified elements.

mutableIntSetOf

public static final @NonNull MutableIntSet mutableIntSetOf(int element1, int element2)

Returns a new MutableIntSet with only element1 and element2 in it.

mutableIntSetOf

public static final @NonNull MutableIntSet mutableIntSetOf(int element1, int element2, int element3)

Returns a new MutableIntSet with only element1, element2, and element3 in it.