LongIntMapKt

Added in 1.4.0

public final class LongIntMapKt


Summary

Public methods

static final @NonNull LongIntMap

Builds a new LongIntMap by populating a MutableLongIntMap using the given builderAction.

static final @NonNull LongIntMap
buildLongIntMap(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongIntMapUnit> builderAction
)

Builds a new LongIntMap by populating a MutableLongIntMap using the given builderAction.

static final @NonNull LongIntMap

Returns an empty, read-only LongIntMap.

static final @NonNull LongIntMap

Returns a new MutableLongIntMap.

static final @NonNull LongIntMap
longIntMapOf(long key1, int value1)

Returns a new LongIntMap with key1 associated with value1.

static final @NonNull LongIntMap
longIntMapOf(long key1, int value1, long key2, int value2)

Returns a new LongIntMap with key1, and key2 associated with value1, and value2, respectively.

static final @NonNull LongIntMap
longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3
)

Returns a new LongIntMap with key1, key2, and key3 associated with value1, value2, and value3, respectively.

static final @NonNull LongIntMap
longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4
)

Returns a new LongIntMap with key1, key2, key3, and key4 associated with value1, value2, value3, and value4, respectively.

static final @NonNull LongIntMap
longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4,
    long key5,
    int value5
)

Returns a new LongIntMap with key1, key2, key3, key4, and key5 associated with value1, value2, value3, value4, and value5, respectively.

static final @NonNull MutableLongIntMap

Returns a new MutableLongIntMap.

static final @NonNull MutableLongIntMap
mutableLongIntMapOf(long key1, int value1)

Returns a new MutableLongIntMap with key1 associated with value1.

static final @NonNull MutableLongIntMap
mutableLongIntMapOf(long key1, int value1, long key2, int value2)

Returns a new MutableLongIntMap with key1, and key2 associated with value1, and value2, respectively.

static final @NonNull MutableLongIntMap
mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3
)

Returns a new MutableLongIntMap with key1, key2, and key3 associated with value1, value2, and value3, respectively.

static final @NonNull MutableLongIntMap
mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4
)

Returns a new MutableLongIntMap with key1, key2, key3, and key4 associated with value1, value2, value3, and value4, respectively.

static final @NonNull MutableLongIntMap
mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4,
    long key5,
    int value5
)

Returns a new MutableLongIntMap with key1, key2, key3, key4, and key5 associated with value1, value2, value3, value4, and value5, respectively.

Public methods

buildLongIntMap

public static final @NonNull LongIntMap buildLongIntMap(
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongIntMapUnit> builderAction
)

Builds a new LongIntMap by populating a MutableLongIntMap 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 MutableLongIntMapUnit> builderAction

Lambda in which the MutableLongIntMap can be populated.

buildLongIntMap

public static final @NonNull LongIntMap buildLongIntMap(
    int initialCapacity,
    @ExtensionFunctionType @NonNull Function1<@NonNull MutableLongIntMapUnit> builderAction
)

Builds a new LongIntMap by populating a MutableLongIntMap 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 pairs added in the builderAction.

@ExtensionFunctionType @NonNull Function1<@NonNull MutableLongIntMapUnit> builderAction

Lambda in which the MutableLongIntMap can be populated.

emptyLongIntMap

public static final @NonNull LongIntMap emptyLongIntMap()

Returns an empty, read-only LongIntMap.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf()

Returns a new MutableLongIntMap.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf(long key1, int value1)

Returns a new LongIntMap with key1 associated with value1.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf(long key1, int value1, long key2, int value2)

Returns a new LongIntMap with key1, and key2 associated with value1, and value2, respectively.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3
)

Returns a new LongIntMap with key1, key2, and key3 associated with value1, value2, and value3, respectively.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4
)

Returns a new LongIntMap with key1, key2, key3, and key4 associated with value1, value2, value3, and value4, respectively.

longIntMapOf

public static final @NonNull LongIntMap longIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4,
    long key5,
    int value5
)

Returns a new LongIntMap with key1, key2, key3, key4, and key5 associated with value1, value2, value3, value4, and value5, respectively.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf()

Returns a new MutableLongIntMap.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf(long key1, int value1)

Returns a new MutableLongIntMap with key1 associated with value1.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf(long key1, int value1, long key2, int value2)

Returns a new MutableLongIntMap with key1, and key2 associated with value1, and value2, respectively.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3
)

Returns a new MutableLongIntMap with key1, key2, and key3 associated with value1, value2, and value3, respectively.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4
)

Returns a new MutableLongIntMap with key1, key2, key3, and key4 associated with value1, value2, value3, and value4, respectively.

mutableLongIntMapOf

public static final @NonNull MutableLongIntMap mutableLongIntMapOf(
    long key1,
    int value1,
    long key2,
    int value2,
    long key3,
    int value3,
    long key4,
    int value4,
    long key5,
    int value5
)

Returns a new MutableLongIntMap with key1, key2, key3, key4, and key5 associated with value1, value2, value3, value4, and value5, respectively.