Rfc822Tokenizer
public class Rfc822Tokenizer
extends Object
implements MultiAutoCompleteTextView.Tokenizer
该类用作MultiAutoCompleteTextView的Tokenizer,用于地址列表字段,还提供将地址字符串(例如可能键入此类字段)转换为一系列Rfc822Token的方法。
Summary
Public constructors
Rfc822Tokenizer
Rfc822Tokenizer ()
Public methods
findTokenEnd
int findTokenEnd (CharSequence text,
int cursor)
返回开始于偏移令牌(减去尾随标点)的端部 cursor
内 text
。
Parameters |
text |
CharSequence
|
cursor |
int
|
findTokenStart
int findTokenStart (CharSequence text,
int cursor)
返回结束于偏移令牌开始 cursor
内 text
。
Parameters |
text |
CharSequence
|
cursor |
int
|
terminateToken
CharSequence terminateToken (CharSequence text)
用逗号和空格终止指定的地址。 这假定指定的文本已经具有有效的语法。 Adapter子类的convertToString()方法必须做出保证。
Parameters |
text |
CharSequence
|
tokenize
void tokenize (CharSequence text,
Collection<Rfc822Token> out)
这个构造函数会尝试使用“Foo Bar(something)<foo \ @ google.com>,blah \ @ google.com(something)”这样的字符串,并将其转换为一个或多个Rfc822Token,输出到提供的集合中。 它不*解码MIME编码的词; 必要时字符集转换必须已经发生。 它会尝试容忍破碎的语法,而不是返回错误。
Parameters |
text |
CharSequence
|
out |
Collection
|
tokenize
Rfc822Token[] tokenize (CharSequence text)
此方法将尝试将“Foo Bar(something)<foo \ @ google.com>,blah \ @ google.com(something)”这样的字符串转换为一个或多个Rfc822Token。 它不*解码MIME编码的词; 必要时字符集转换必须已经发生。 它会尝试容忍破碎的语法,而不是返回错误。
Parameters |
text |
CharSequence
|