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

SetSelectionCommand

public final class SetSelectionCommand implements EditCommand


Sets the selection on the text. When start and end have the same value, it sets the cursor position.

See setSelection.

Summary

Public constructors

SetSelectionCommand(int start, int end)

Public methods

void

Apply the command on the editing buffer.

boolean
equals(Object other)
final int

The exclusive end offset of the selection region.

final int

The inclusive start offset of the selection region.

int
@NonNull String

Public constructors

SetSelectionCommand

public SetSelectionCommand(int start, int end)
Parameters
int start

The inclusive start offset of the selection region.

int end

The exclusive end offset of the selection region.

Public methods

applyTo

public void applyTo(@NonNull EditingBuffer buffer)

Apply the command on the editing buffer.

equals

public boolean equals(Object other)

getEnd

public final int getEnd()

The exclusive end offset of the selection region.

getStart

public final int getStart()

The inclusive start offset of the selection region.

hashCode

public int hashCode()

toString

public @NonNull String toString()