Instance Method インスタンスメソッド

shiftIndexesStarting(at:by:)

Shifts a group of indexes to the left or the right within the receiver. インデックスいくらかからなるあるグループを左または右へレシーバの中でずらします。

Declaration 宣言

func shiftIndexesStarting(at index: Int, 
                       by delta: Int)

Parameters パラメータ

startIndex

Head of the group of indexes to shift. ずらすインデックスのグループの冒頭。

delta

Amount and direction of the shift. Positive integers shift the indexes to the right. Negative integers shift the indexes to the left. ずらしの量と方向。正の整数はインデックスを右にずらします。負の整数はインデックスを左にずらします。

Discussion 議論

The group of indexes shifted is made up by startIndex and the indexes that follow it in the set. ずらされるインデックスのグループは、startIndexと集合においてそれに続くインデックスによって作り上げられます。

A left shift deletes the indexes in a range the length of delta preceding startIndex from the set. 左ずらしは、deltaの長さstartIndexから先行する範囲の中のインデックスを集合から削除します。

A right shift inserts empty space in the range (startIndex,delta) in the receiver. 右ずらしは、空の空間を範囲(startIndex,delta)の中にレシーバにおいて挿入します。

The resulting indexes must all be in the range 0 .. NSNotFound - 1.