DoubleListKt

Added in 1.5.0-alpha06

public final class DoubleListKt


Summary

Public methods

static final @NonNull DoubleList

Builds a new DoubleList by populating a MutableDoubleList using the given builderAction.

static final @NonNull DoubleList
buildDoubleList(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableDoubleListUnit> builderAction
)

Builds a new DoubleList by populating a MutableDoubleList using the given builderAction.

static final @NonNull DoubleList
static final @NonNull DoubleList
doubleListOf(double element1)
static final @NonNull DoubleList
doubleListOf(double elements)
static final @NonNull DoubleList
doubleListOf(double element1, double element2)
static final @NonNull DoubleList
doubleListOf(double element1, double element2, double element3)
static final @NonNull DoubleList
static final @NonNull MutableDoubleList
static final @NonNull MutableDoubleList
mutableDoubleListOf(double element1)
static final @NonNull MutableDoubleList
mutableDoubleListOf(double elements)
static final @NonNull MutableDoubleList
mutableDoubleListOf(double element1, double element2)
static final @NonNull MutableDoubleList
mutableDoubleListOf(double element1, double element2, double element3)

Public methods

buildDoubleList

public static final @NonNull DoubleList buildDoubleList(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableDoubleListUnit> builderAction
)

Builds a new DoubleList by populating a MutableDoubleList 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 MutableDoubleListUnit> builderAction

Lambda in which the MutableDoubleList can be populated.

buildDoubleList

public static final @NonNull DoubleList buildDoubleList(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableDoubleListUnit> builderAction
)

Builds a new DoubleList by populating a MutableDoubleList 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 MutableDoubleListUnit> builderAction

Lambda in which the MutableDoubleList can be populated.

doubleListOf

public static final @NonNull DoubleList doubleListOf()
Returns
@NonNull DoubleList

a read-only DoubleList with nothing in it.

doubleListOf

public static final @NonNull DoubleList doubleListOf(double element1)
Returns
@NonNull DoubleList

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

doubleListOf

public static final @NonNull DoubleList doubleListOf(double elements)
Returns
@NonNull DoubleList

a new read-only DoubleList with elements in order.

doubleListOf

public static final @NonNull DoubleList doubleListOf(double element1, double element2)
Returns
@NonNull DoubleList

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

doubleListOf

public static final @NonNull DoubleList doubleListOf(double element1, double element2, double element3)
Returns
@NonNull DoubleList

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

emptyDoubleList

public static final @NonNull DoubleList emptyDoubleList()
Returns
@NonNull DoubleList

a read-only DoubleList with nothing in it.

mutableDoubleListOf

public static final @NonNull MutableDoubleList mutableDoubleListOf()
Returns
@NonNull MutableDoubleList

a new empty MutableDoubleList with the default capacity.

mutableDoubleListOf

public static final @NonNull MutableDoubleList mutableDoubleListOf(double element1)
Returns
@NonNull MutableDoubleList

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

mutableDoubleListOf

public static final @NonNull MutableDoubleList mutableDoubleListOf(double elements)
Returns
@NonNull MutableDoubleList

a new MutableDoubleList with the given elements, in order.

mutableDoubleListOf

public static final @NonNull MutableDoubleList mutableDoubleListOf(double element1, double element2)
Returns
@NonNull MutableDoubleList

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

mutableDoubleListOf

public static final @NonNull MutableDoubleList mutableDoubleListOf(double element1, double element2, double element3)
Returns
@NonNull MutableDoubleList

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