文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
TokenIterator
This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.
Constructors
- new TokenIterator(EditSession session, Number initialRow, Number initialColumn)
Creates a new token iterator object. The initial token index is set to the provided row and column coordinates.
session | EditSession | Required. The session to associate with |
initialRow | Number | Required. The row to start the tokenizing at |
initialColumn | Number | Required. The column to start the tokenizing at |
Methods
- TokenIterator.getCurrentToken()
- 返回值: String
Returns the current tokenized string.
- TokenIterator.getCurrentTokenColumn()
- 返回值: Number
Returns the current column.
- TokenIterator.getCurrentTokenRow()
- 返回值: Number
Returns the current row.
- TokenIterator.stepBackward()
- 返回值: String
Tokenizes all the items from the current point to the row prior in the document.
- TokenIterator.stepForward()
- 返回值: String
Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null
. Otherwise, it returns the tokenized string.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论