GetChars

  • GetChars interface provides an efficient way to extract characters from a CharSequence, improving performance over repeated charAt() calls.

  • Implement this interface if your custom CharSequence has a getChars() method for faster character extraction.

  • This interface is implemented by key Android classes like Editable, SpannableString, SpannableStringBuilder, and SpannedString for optimized character access.

  • The primary method, getChars(), allows copying a range of characters to a destination array, similar to the functionality in the String class.

public interface GetChars implements CharSequence
Known Indirect Subclasses

Please implement this interface if your CharSequence has a getChars() method like the one in String that is faster than calling charAt() multiple times.

Public Method Summary

abstract void
getChars(int start, int end, char[] dest, int destoff)
Exactly like String.getChars(): copy chars start through end - 1 from this CharSequence into dest beginning at offset destoff.

Inherited Method Summary

Public Methods

public abstract void getChars (int start, int end, char[] dest, int destoff)

Exactly like String.getChars(): copy chars start through end - 1 from this CharSequence into dest beginning at offset destoff.

Parameters
start
end
dest
destoff