TokenIterator

优质
小牛编辑
131浏览
2023-12-01

This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.

Constructors

Creates a new token iterator object. The initial token index is set to the provided row and column coordinates.

sessionEditSessionRequired. The session to associate with
initialRowNumberRequired. The row to start the tokenizing at
initialColumnNumberRequired. 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.