{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

MoveCursorCommand

public final class MoveCursorCommand implements EditCommand


Moves the cursor with amount characters.

If there is selection, cancel the selection first and move the cursor to the selection start position. Then perform the cursor movement.

Summary

Public constructors

MoveCursorCommand(int amount)

Public methods

void

Apply the command on the editing buffer.

boolean
equals(Object other)
final int

The amount of cursor movement.

int
@NonNull String

Public constructors

MoveCursorCommand

public MoveCursorCommand(int amount)
Parameters
int amount

The amount of cursor movement. If you want to move backward, pass negative value.

Public methods

applyTo

public void applyTo(@NonNull EditingBuffer buffer)

Apply the command on the editing buffer.

equals

public boolean equals(Object other)

getAmount

public final int getAmount()

The amount of cursor movement. If you want to move backward, pass negative value.

hashCode

public int hashCode()

toString

public @NonNull String toString()