MenuKt

Added in 1.1.0

public final class MenuKt


Summary

Public methods

static final boolean
contains(@NonNull Menu receiver, @NonNull MenuItem item)

Returns true if item is found in this menu.

static final void
forEach(
    @NonNull Menu receiver,
    @NonNull Function1<@NonNull MenuItemUnit> action
)

Performs the given action on each item in this menu.

static final void
forEachIndexed(
    @NonNull Menu receiver,
    @NonNull Function2<@NonNull Integer, @NonNull MenuItemUnit> action
)

Performs the given action on each item in this menu, providing its sequential index.

static final @NonNull MenuItem
get(@NonNull Menu receiver, int index)

Returns the menu at index.

static final @NonNull Sequence<@NonNull MenuItem>

Returns a Sequence over the items in this menu.

static final int
getSize(@NonNull Menu receiver)

Returns the number of items in this menu.

static final boolean
isEmpty(@NonNull Menu receiver)

Returns true if this menu contains no items.

static final boolean
isNotEmpty(@NonNull Menu receiver)

Returns true if this menu contains one or more items.

static final @NonNull Iterator<@NonNull MenuItem>
iterator(@NonNull Menu receiver)

Returns a MutableIterator over the items in this menu.

static final void
minusAssign(@NonNull Menu receiver, @NonNull MenuItem item)

Removes item from this menu.

static final void
removeItemAt(@NonNull Menu receiver, int index)

Removes the menu item at the specified index.

Public methods

contains

public static final boolean contains(@NonNull Menu receiver, @NonNull MenuItem item)

Returns true if item is found in this menu.

forEach

public static final void forEach(
    @NonNull Menu receiver,
    @NonNull Function1<@NonNull MenuItemUnit> action
)

Performs the given action on each item in this menu.

forEachIndexed

public static final void forEachIndexed(
    @NonNull Menu receiver,
    @NonNull Function2<@NonNull Integer, @NonNull MenuItemUnit> action
)

Performs the given action on each item in this menu, providing its sequential index.

get

public static final @NonNull MenuItem get(@NonNull Menu receiver, int index)

Returns the menu at index.

Throws
kotlin.IndexOutOfBoundsException

if index is less than 0 or greater than or equal to the count.

getChildren

public static final @NonNull Sequence<@NonNull MenuItemgetChildren(@NonNull Menu receiver)

Returns a Sequence over the items in this menu.

getSize

public static final int getSize(@NonNull Menu receiver)

Returns the number of items in this menu.

isEmpty

public static final boolean isEmpty(@NonNull Menu receiver)

Returns true if this menu contains no items.

isNotEmpty

public static final boolean isNotEmpty(@NonNull Menu receiver)

Returns true if this menu contains one or more items.

iterator

public static final @NonNull Iterator<@NonNull MenuItemiterator(@NonNull Menu receiver)

Returns a MutableIterator over the items in this menu.

minusAssign

public static final void minusAssign(@NonNull Menu receiver, @NonNull MenuItem item)

Removes item from this menu.

removeItemAt

public static final void removeItemAt(@NonNull Menu receiver, int index)

Removes the menu item at the specified index.

Throws
kotlin.IndexOutOfBoundsException

if index is less than 0 or greater than or equal to the count.