FloatListKt

Added in 1.4.0

public final class FloatListKt


Summary

Public methods

static final @NonNull FloatList

Builds a new FloatList by populating a MutableFloatList using the given builderAction.

static final @NonNull FloatList
buildFloatList(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatListUnit> builderAction
)

Builds a new FloatList by populating a MutableFloatList using the given builderAction.

static final @NonNull FloatList
static final @NonNull FloatList
static final @NonNull FloatList
floatListOf(float element1)
static final @NonNull FloatList
floatListOf(float elements)
static final @NonNull FloatList
floatListOf(float element1, float element2)
static final @NonNull FloatList
floatListOf(float element1, float element2, float element3)
static final @NonNull MutableFloatList
static final @NonNull MutableFloatList
mutableFloatListOf(float element1)
static final @NonNull MutableFloatList
mutableFloatListOf(float elements)
static final @NonNull MutableFloatList
mutableFloatListOf(float element1, float element2)
static final @NonNull MutableFloatList
mutableFloatListOf(float element1, float element2, float element3)

Public methods

buildFloatList

public static final @NonNull FloatList buildFloatList(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatListUnit> builderAction
)

Builds a new FloatList by populating a MutableFloatList using the given builderAction.

The instance 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 MutableFloatListUnit> builderAction

Lambda in which the MutableFloatList can be populated.

buildFloatList

public static final @NonNull FloatList buildFloatList(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableFloatListUnit> builderAction
)

Builds a new FloatList by populating a MutableFloatList using the given builderAction.

The instance 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 MutableFloatListUnit> builderAction

Lambda in which the MutableFloatList can be populated.

emptyFloatList

public static final @NonNull FloatList emptyFloatList()
Returns
@NonNull FloatList

a read-only FloatList with nothing in it.

floatListOf

public static final @NonNull FloatList floatListOf()
Returns
@NonNull FloatList

a read-only FloatList with nothing in it.

floatListOf

public static final @NonNull FloatList floatListOf(float element1)
Returns
@NonNull FloatList

a new read-only FloatList with element1 as the only item in the list.

floatListOf

public static final @NonNull FloatList floatListOf(float elements)
Returns
@NonNull FloatList

a new read-only FloatList with elements in order.

floatListOf

public static final @NonNull FloatList floatListOf(float element1, float element2)
Returns
@NonNull FloatList

a new read-only FloatList with 2 elements, element1 and element2, in order.

floatListOf

public static final @NonNull FloatList floatListOf(float element1, float element2, float element3)
Returns
@NonNull FloatList

a new read-only FloatList with 3 elements, element1, element2, and element3, in order.

mutableFloatListOf

public static final @NonNull MutableFloatList mutableFloatListOf()
Returns
@NonNull MutableFloatList

a new empty MutableFloatList with the default capacity.

mutableFloatListOf

public static final @NonNull MutableFloatList mutableFloatListOf(float element1)
Returns
@NonNull MutableFloatList

a new MutableFloatList with element1 as the only item in the list.

mutableFloatListOf

public static final @NonNull MutableFloatList mutableFloatListOf(float elements)
Returns
@NonNull MutableFloatList

a new MutableFloatList with the given elements, in order.

mutableFloatListOf

public static final @NonNull MutableFloatList mutableFloatListOf(float element1, float element2)
Returns
@NonNull MutableFloatList

a new MutableFloatList with 2 elements, element1 and element2, in order.

mutableFloatListOf

public static final @NonNull MutableFloatList mutableFloatListOf(float element1, float element2, float element3)
Returns
@NonNull MutableFloatList

a new MutableFloatList with 3 elements, element1, element2, and element3, in order.