FloatSetKt

Added in 1.4.0

public final class FloatSetKt


Summary

Public methods

static final @NonNull FloatSet
buildFloatSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatSetUnit> builderAction
)

Builds a new FloatSet by populating a MutableFloatSet using the given builderAction.

static final @NonNull FloatSet
buildFloatSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatSetUnit> builderAction
)

Builds a new FloatSet by populating a MutableFloatSet using the given builderAction.

static final @NonNull FloatSet

Returns an empty, read-only FloatSet.

static final @NonNull FloatSet

Returns an empty, read-only ScatterSet.

static final @NonNull FloatSet
floatSetOf(float element1)

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

static final @NonNull FloatSet
floatSetOf(float elements)

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

static final @NonNull FloatSet
floatSetOf(float element1, float element2)

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

static final @NonNull FloatSet
floatSetOf(float element1, float element2, float element3)

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

static final @NonNull MutableFloatSet

Returns a new MutableFloatSet.

static final @NonNull MutableFloatSet
mutableFloatSetOf(float element1)

Returns a new MutableFloatSet with only element1 in it.

static final @NonNull MutableFloatSet
mutableFloatSetOf(float elements)

Returns a new MutableFloatSet with the specified elements.

static final @NonNull MutableFloatSet
mutableFloatSetOf(float element1, float element2)

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

static final @NonNull MutableFloatSet
mutableFloatSetOf(float element1, float element2, float element3)

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

Public methods

buildFloatSet

public static final @NonNull FloatSet buildFloatSet(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatSetUnit> builderAction
)

Builds a new FloatSet by populating a MutableFloatSet 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 MutableFloatSetUnit> builderAction

Lambda in which the MutableFloatSet can be populated.

buildFloatSet

public static final @NonNull FloatSet buildFloatSet(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatSetUnit> builderAction
)

Builds a new FloatSet by populating a MutableFloatSet 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 MutableFloatSetUnit> builderAction

Lambda in which the MutableFloatSet can be populated.

emptyFloatSet

public static final @NonNull FloatSet emptyFloatSet()

Returns an empty, read-only FloatSet.

floatSetOf

public static final @NonNull FloatSet floatSetOf()

Returns an empty, read-only ScatterSet.

floatSetOf

public static final @NonNull FloatSet floatSetOf(float element1)

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

floatSetOf

public static final @NonNull FloatSet floatSetOf(float elements)

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

floatSetOf

public static final @NonNull FloatSet floatSetOf(float element1, float element2)

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

floatSetOf

public static final @NonNull FloatSet floatSetOf(float element1, float element2, float element3)

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

mutableFloatSetOf

public static final @NonNull MutableFloatSet mutableFloatSetOf()

Returns a new MutableFloatSet.

mutableFloatSetOf

public static final @NonNull MutableFloatSet mutableFloatSetOf(float element1)

Returns a new MutableFloatSet with only element1 in it.

mutableFloatSetOf

public static final @NonNull MutableFloatSet mutableFloatSetOf(float elements)

Returns a new MutableFloatSet with the specified elements.

mutableFloatSetOf

public static final @NonNull MutableFloatSet mutableFloatSetOf(float element1, float element2)

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

mutableFloatSetOf

public static final @NonNull MutableFloatSet mutableFloatSetOf(float element1, float element2, float element3)

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