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

DeleteSurroundingTextCommand

public final class DeleteSurroundingTextCommand implements EditCommand


Delete lengthBeforeCursor characters of text before the current cursor position, and delete lengthAfterCursor characters of text after the current cursor position, excluding the selection.

Before and after refer to the order of the characters in the string, not to their visual representation.

See deleteSurroundingText.

Summary

Public constructors

DeleteSurroundingTextCommand(
    int lengthBeforeCursor,
    int lengthAfterCursor
)

Public methods

void

Apply the command on the editing buffer.

boolean
equals(Object other)
final int

The number of characters in UTF-16 after the cursor to be deleted.

final int

The number of characters in UTF-16 before the cursor to be deleted.

int
@NonNull String

Public constructors

DeleteSurroundingTextCommand

public DeleteSurroundingTextCommand(
    int lengthBeforeCursor,
    int lengthAfterCursor
)
Parameters
int lengthBeforeCursor

The number of characters in UTF-16 before the cursor to be deleted. Must be non-negative.

int lengthAfterCursor

The number of characters in UTF-16 after the cursor to be deleted. Must be non-negative.

Public methods

applyTo

public void applyTo(@NonNull EditingBuffer buffer)

Apply the command on the editing buffer.

equals

public boolean equals(Object other)

getLengthAfterCursor

public final int getLengthAfterCursor()

The number of characters in UTF-16 after the cursor to be deleted. Must be non-negative.

getLengthBeforeCursor

public final int getLengthBeforeCursor()

The number of characters in UTF-16 before the cursor to be deleted. Must be non-negative.

hashCode

public int hashCode()

toString

public @NonNull String toString()