Stay organized with collections
Save and categorize content based on your preferences.
MultiAutoCompleteTextView.Tokenizer
public
static
interface
MultiAutoCompleteTextView.Tokenizer
android.widget.MultiAutoCompleteTextView.Tokenizer
|
Known indirect subclasses
MultiAutoCompleteTextView.CommaTokenizer |
This simple Tokenizer can be used for lists where the items are
separated by a comma and one or more spaces.
|
Rfc822Tokenizer |
This class works as a Tokenizer for MultiAutoCompleteTextView for
address list fields, and also provides a method for converting
a string of addresses (such as might be typed into such a field)
into a series of Rfc822Tokens.
|
|
Summary
Public methods |
abstract
int
|
findTokenEnd(CharSequence text, int cursor)
Returns the end of the token (minus trailing punctuation)
that begins at offset cursor within text .
|
abstract
int
|
findTokenStart(CharSequence text, int cursor)
Returns the start of the token that ends at offset
cursor within text .
|
abstract
CharSequence
|
terminateToken(CharSequence text)
Returns text , modified, if necessary, to ensure that
it ends with a token terminator (for example a space or comma).
|
Public methods
findTokenEnd
public abstract int findTokenEnd (CharSequence text,
int cursor)
Returns the end of the token (minus trailing punctuation)
that begins at offset cursor
within text
.
Parameters |
text |
CharSequence |
cursor |
int |
findTokenStart
public abstract int findTokenStart (CharSequence text,
int cursor)
Returns the start of the token that ends at offset
cursor
within text
.
Parameters |
text |
CharSequence |
cursor |
int |
terminateToken
public abstract CharSequence terminateToken (CharSequence text)
Returns text
, modified, if necessary, to ensure that
it ends with a token terminator (for example a space or comma).
Parameters |
text |
CharSequence |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MultiAutoCompleteTextView.Tokenizer\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nMultiAutoCompleteTextView.Tokenizer\n===================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/widget/MultiAutoCompleteTextView.Tokenizer \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMultiAutoCompleteTextView.Tokenizer\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------|\n| android.widget.MultiAutoCompleteTextView.Tokenizer |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [MultiAutoCompleteTextView.CommaTokenizer](/reference/android/widget/MultiAutoCompleteTextView.CommaTokenizer), [Rfc822Tokenizer](/reference/android/text/util/Rfc822Tokenizer) |----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [MultiAutoCompleteTextView.CommaTokenizer](/reference/android/widget/MultiAutoCompleteTextView.CommaTokenizer) | This simple Tokenizer can be used for lists where the items are separated by a comma and one or more spaces. | | [Rfc822Tokenizer](/reference/android/text/util/Rfc822Tokenizer) | This class works as a Tokenizer for MultiAutoCompleteTextView for address list fields, and also provides a method for converting a string of addresses (such as might be typed into such a field) into a series of Rfc822Tokens. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[findTokenEnd](/reference/android/widget/MultiAutoCompleteTextView.Tokenizer#findTokenEnd(java.lang.CharSequence,%20int))`(`[CharSequence](/reference/java/lang/CharSequence)` text, int cursor) ` Returns the end of the token (minus trailing punctuation) that begins at offset `cursor` within `text`. |\n| ` abstract int` | ` `[findTokenStart](/reference/android/widget/MultiAutoCompleteTextView.Tokenizer#findTokenStart(java.lang.CharSequence,%20int))`(`[CharSequence](/reference/java/lang/CharSequence)` text, int cursor) ` Returns the start of the token that ends at offset `cursor` within `text`. |\n| ` abstract `[CharSequence](/reference/java/lang/CharSequence) | ` `[terminateToken](/reference/android/widget/MultiAutoCompleteTextView.Tokenizer#terminateToken(java.lang.CharSequence))`(`[CharSequence](/reference/java/lang/CharSequence)` text) ` Returns `text`, modified, if necessary, to ensure that it ends with a token terminator (for example a space or comma). |\n\nPublic methods\n--------------\n\n### findTokenEnd\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int findTokenEnd (CharSequence text, \n int cursor)\n```\n\nReturns the end of the token (minus trailing punctuation)\nthat begins at offset `cursor` within `text`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-----------------------|\n| `text` | `CharSequence` \u003cbr /\u003e |\n| `cursor` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### findTokenStart\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int findTokenStart (CharSequence text, \n int cursor)\n```\n\nReturns the start of the token that ends at offset\n`cursor` within `text`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-----------------------|\n| `text` | `CharSequence` \u003cbr /\u003e |\n| `cursor` | `int` \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### terminateToken\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract CharSequence terminateToken (CharSequence text)\n```\n\nReturns `text`, modified, if necessary, to ensure that\nit ends with a token terminator (for example a space or comma).\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|-----------------------|\n| `text` | `CharSequence` \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------------------|--------|\n| [CharSequence](/reference/java/lang/CharSequence) | \u003cbr /\u003e |"]]