Stay organized with collections
Save and categorize content based on your preferences.
Rfc822Tokenizer
open class Rfc822Tokenizer : MultiAutoCompleteTextView.Tokenizer
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 |
open Int |
Returns the end of the token (minus trailing punctuation) that begins at offset cursor within text .
|
open Int |
Returns the start of the token that ends at offset cursor within text .
|
open CharSequence! |
Terminates the specified address with a comma and space.
|
open static Array<Rfc822Token!>! |
This method will try to take a string like "Foo Bar (something) <foo\@google.
|
open static Unit |
This constructor will try to take a string like "Foo Bar (something) <foo\@google.
|
Public constructors
Rfc822Tokenizer
Rfc822Tokenizer()
Public methods
findTokenEnd
open fun findTokenEnd(
text: CharSequence!,
cursor: Int
): Int
Returns the end of the token (minus trailing punctuation) that begins at offset cursor
within text
.
findTokenStart
open fun findTokenStart(
text: CharSequence!,
cursor: Int
): Int
Returns the start of the token that ends at offset cursor
within text
.
terminateToken
open fun terminateToken(text: CharSequence!): CharSequence!
Terminates the specified address with a comma and space. This assumes that the specified text already has valid syntax. The Adapter subclass's convertToString() method must make that guarantee.
tokenize
open static fun tokenize(text: CharSequence!): Array<Rfc822Token!>!
This method will try to take a string like "Foo Bar (something) <foo\@google.com>, blah\@google.com (something)" and convert it into one or more Rfc822Tokens. It does *not* decode MIME encoded-words; charset conversion must already have taken place if necessary. It will try to be tolerant of broken syntax instead of returning an error.
tokenize
open static fun tokenize(
text: CharSequence!,
out: MutableCollection<Rfc822Token!>!
): Unit
This constructor will try to take a string like "Foo Bar (something) <foo\@google.com>, blah\@google.com (something)" and convert it into one or more Rfc822Tokens, output into the supplied collection. It does *not* decode MIME encoded-words; charset conversion must already have taken place if necessary. It will try to be tolerant of broken syntax instead of returning an error.
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,["# Rfc822Tokenizer\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRfc822Tokenizer\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/util/Rfc822Tokenizer \"View this page in Java\") \n\n```\nopen class Rfc822Tokenizer : MultiAutoCompleteTextView.Tokenizer\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.text.util.Rfc822Tokenizer](#) |\n\nThis 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\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------|---|\n| [Rfc822Tokenizer](#Rfc822Tokenizer())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [findTokenEnd](#findTokenEnd(kotlin.CharSequence,%20kotlin.Int))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `cursor:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the end of the token (minus trailing punctuation) that begins at offset `cursor` within `text`. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [findTokenStart](#findTokenStart(kotlin.CharSequence,%20kotlin.Int))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `cursor:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns the start of the token that ends at offset `cursor` within `text`. |\n| open [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | [terminateToken](#terminateToken(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Terminates the specified address with a comma and space. |\n| open static [Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\\\u003c[Rfc822Token](/reference/kotlin/android/text/util/Rfc822Token)!\\\u003e! | [tokenize](#tokenize(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` This method will try to take a string like \"Foo Bar (something) \\\u003cfoo\\\\@google. |\n| open static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [tokenize](#tokenize(kotlin.CharSequence,%20kotlin.collections.MutableCollection))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `out:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\u003c[Rfc822Token](/reference/kotlin/android/text/util/Rfc822Token)!\u003e!`)` This constructor will try to take a string like \"Foo Bar (something) \\\u003cfoo\\\\@google. |\n\nPublic constructors\n-------------------\n\n### Rfc822Tokenizer\n\n```\nRfc822Tokenizer()\n```\n\nPublic methods\n--------------\n\n### findTokenEnd\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun findTokenEnd(\n text: CharSequence!, \n cursor: Int\n): Int\n```\n\nReturns the end of the token (minus trailing punctuation) that begins at offset `cursor` within `text`. \n\n### findTokenStart\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun findTokenStart(\n text: CharSequence!, \n cursor: Int\n): Int\n```\n\nReturns the start of the token that ends at offset `cursor` within `text`. \n\n### terminateToken\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun terminateToken(text: CharSequence!): CharSequence!\n```\n\nTerminates the specified address with a comma and space. This assumes that the specified text already has valid syntax. The Adapter subclass's convertToString() method must make that guarantee. \n\n### tokenize\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun tokenize(text: CharSequence!): Array\u003cRfc822Token!\u003e!\n```\n\nThis method will try to take a string like \"Foo Bar (something) \\\u003cfoo\\\\@google.com\\\u003e, blah\\\\@google.com (something)\" and convert it into one or more Rfc822Tokens. It does \\*not\\* decode MIME encoded-words; charset conversion must already have taken place if necessary. It will try to be tolerant of broken syntax instead of returning an error. \n\n### tokenize\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun tokenize(\n text: CharSequence!, \n out: MutableCollection\u003cRfc822Token!\u003e!\n): Unit\n```\n\nThis constructor will try to take a string like \"Foo Bar (something) \\\u003cfoo\\\\@google.com\\\u003e, blah\\\\@google.com (something)\" and convert it into one or more Rfc822Tokens, output into the supplied collection. It does \\*not\\* decode MIME encoded-words; charset conversion must already have taken place if necessary. It will try to be tolerant of broken syntax instead of returning an error."]]