LongSetKt

Added in 1.4.0

public final class LongSetKt


Summary

Public methods

static final @NonNull LongSet
buildLongSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongSetUnit> builderAction
)

Builds a new LongSet by populating a MutableLongSet using the given builderAction.

static final @NonNull LongSet
buildLongSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongSetUnit> builderAction
)

Builds a new LongSet by populating a MutableLongSet using the given builderAction.

static final @NonNull LongSet

Returns an empty, read-only LongSet.

static final @NonNull LongSet

Returns an empty, read-only ScatterSet.

static final @NonNull LongSet
longSetOf(long element1)

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

static final @NonNull LongSet
longSetOf(long elements)

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

static final @NonNull LongSet
longSetOf(long element1, long element2)

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

static final @NonNull LongSet
longSetOf(long element1, long element2, long element3)

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

static final @NonNull MutableLongSet

Returns a new MutableLongSet.

static final @NonNull MutableLongSet
mutableLongSetOf(long element1)

Returns a new MutableLongSet with only element1 in it.

static final @NonNull MutableLongSet
mutableLongSetOf(long elements)

Returns a new MutableLongSet with the specified elements.

static final @NonNull MutableLongSet
mutableLongSetOf(long element1, long element2)

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

static final @NonNull MutableLongSet
mutableLongSetOf(long element1, long element2, long element3)

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

Public methods

buildLongSet

public static final @NonNull LongSet buildLongSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongSetUnit> builderAction
)

Builds a new LongSet by populating a MutableLongSet 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 MutableLongSetUnit> builderAction

Lambda in which the MutableLongSet can be populated.

buildLongSet

public static final @NonNull LongSet buildLongSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongSetUnit> builderAction
)

Builds a new LongSet by populating a MutableLongSet 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 MutableLongSetUnit> builderAction

Lambda in which the MutableLongSet can be populated.

emptyLongSet

public static final @NonNull LongSet emptyLongSet()

Returns an empty, read-only LongSet.

longSetOf

public static final @NonNull LongSet longSetOf()

Returns an empty, read-only ScatterSet.

longSetOf

public static final @NonNull LongSet longSetOf(long element1)

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

longSetOf

public static final @NonNull LongSet longSetOf(long elements)

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

longSetOf

public static final @NonNull LongSet longSetOf(long element1, long element2)

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

longSetOf

public static final @NonNull LongSet longSetOf(long element1, long element2, long element3)

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

mutableLongSetOf

public static final @NonNull MutableLongSet mutableLongSetOf()

Returns a new MutableLongSet.

mutableLongSetOf

public static final @NonNull MutableLongSet mutableLongSetOf(long element1)

Returns a new MutableLongSet with only element1 in it.

mutableLongSetOf

public static final @NonNull MutableLongSet mutableLongSetOf(long elements)

Returns a new MutableLongSet with the specified elements.

mutableLongSetOf

public static final @NonNull MutableLongSet mutableLongSetOf(long element1, long element2)

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

mutableLongSetOf

public static final @NonNull MutableLongSet mutableLongSetOf(long element1, long element2, long element3)

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