返回介绍

Range

发布于 2019-12-03 22:53:38 字数 30850 浏览 1173 评论 0 收藏 0

This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogous to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.

Constructors

Creates a new Range object with the given starting and ending row and column points.

startRowNumberRequired. The starting row
startColumnNumberRequired. The starting column
endRowNumberRequired. The ending row
endColumnNumberRequired. The ending column

Methods

Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.

firstRowNumberRequired. The starting row
lastRowNumberRequired. The ending row
  • Range.clone()
  • 返回值: Range

Returns a duplicate of the calling range.

  • Range.collapseRows()
  • 返回值: Range

Returns a range containing the starting and ending rows of the original range, but with a column value of 0.

Checks the row and column points with the row and column points of the calling range.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Checks the row and column points with the row and column points of the calling range.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Checks the row and column points with the row and column points of the calling range.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Checks the row and column points of p with the row and column points of the calling range.

pRangeRequired. A point to compare with

Compares this range (A) with another range (B).

rangeRangeRequired. A range to compare with

Checks the row and column points with the row and column points of the calling range.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:

   this.start.row <= row <= this.end.row &&
   this.start.column <= column <= this.end.column
rowNumberRequired. A row to check for
columnNumberRequired. A column to check for

Checks the start and end points of range and compares them to the calling range. Returns true if the range is contained within the caller's range.

rangeRangeRequired. A range to compare with

Changes the row and column points for the calling range for both the starting and ending points.

rowNumberRequired. A new row to extend to
columnNumberRequired. A new column to extend to

Creates and returns a new Range based on the row and column of the given parameters.

startRangeRequired. A starting point to use
endRangeRequired. An ending point to use

Returns true if the row and column are within the given range.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Returns true if the row and column are within the given range's ending points.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Returns true if the row and column are within the given range's starting points.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Returns true if passed in range intersects with the one calling this method.

rangeRangeRequired. A range to compare with
  • Range.isEmpty()
  • Undocumented

Returns true if the caller's ending row point is the same as row, and if the caller's ending column is the same as column.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Returns true if and only if the starting row and column, and ending row and column, are equivalent to those given by range.

rangeRangeRequired. A range to check against
  • Range.isMultiLine()
  • 返回值: Boolean

Returns true if the range spans across multiple lines.

Returns true if the caller's starting row point is the same as row, and if the caller's starting column is the same as column.

rowNumberRequired. A row point to compare with
columnNumberRequired. A column point to compare with

Sets the starting row and column for the range.

rowNumberRequired. A row point to set
columnNumberRequired. A column point to set

Sets the starting row and column for the range.

rowNumberRequired. A row point to set
columnNumberRequired. A column point to set

Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.

sessionEditSessionRequired. The EditSession to retrieve coordinates from
  • Range.toString()
  • 返回值: String

Returns a string containing the range's row and column information, given like this:

   [start.row/start.column] -> [end.row/end.column]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文