NSMutableOrderedSet
NSMutableOrderedSet 是可变的有序去重集合。
类成员 (Class members)
Section titled “类成员 (Class members)”orderedSetWithCapacity
Section titled “orderedSetWithCapacity”预分配容量创建。
static orderedSetWithCapacity(numItems: number): NSMutableOrderedSetParameters:
| Name | Type | Description |
|---|---|---|
numItems | number | 初始容量。 |
Return Value:
NSMutableOrderedSet: 新有序集。
实例成员 (Instance members)
Section titled “实例成员 (Instance members)”addObject
Section titled “addObject”在末尾添加元素(若已存在则无变化)。
addObject(object: any): voidParameters:
| Name | Type | Description |
|---|---|---|
object | any | 要添加的元素。 |
Return Value:
- 无。
addObjectsCount
Section titled “addObjectsCount”从 C 数组与长度添加多个元素。
addObjectsCount(objects: any, count: number): voidParameters:
| Name | Type | Description |
|---|---|---|
objects | any | 元素序列。 |
count | number | 个数。 |
Return Value:
- 无。
addObjectsFromArray
Section titled “addObjectsFromArray”将数组中的元素加入有序集。
addObjectsFromArray(array: NSArray): voidParameters:
| Name | Type | Description |
|---|---|---|
array | NSArray | 源数组。 |
Return Value:
- 无。
insertObjectAtIndex
Section titled “insertObjectAtIndex”在指定下标插入元素。
insertObjectAtIndex(object: any, idx: number): voidParameters:
| Name | Type | Description |
|---|---|---|
object | any | 要插入的元素。 |
idx | number | 下标。 |
Return Value:
- 无。
insertObjectsAtIndexes
Section titled “insertObjectsAtIndexes”在指定索引集位置插入多个元素。
insertObjectsAtIndexes(objects: NSArray, indexes: NSIndexSet): voidParameters:
| Name | Type | Description |
|---|---|---|
objects | NSArray | 要插入的元素数组。 |
indexes | NSIndexSet | 下标集合。 |
Return Value:
- 无。
removeObjectAtIndex
Section titled “removeObjectAtIndex”移除指定下标的元素。
removeObjectAtIndex(idx: number): voidParameters:
| Name | Type | Description |
|---|---|---|
idx | number | 下标。 |
Return Value:
- 无。
removeObjectsAtIndexes
Section titled “removeObjectsAtIndexes”移除索引集中的下标对应元素。
removeObjectsAtIndexes(indexes: NSIndexSet): voidParameters:
| Name | Type | Description |
|---|---|---|
indexes | NSIndexSet | 要移除的下标集合。 |
Return Value:
- 无。
removeObjectsInRange
Section titled “removeObjectsInRange”移除范围内元素。
removeObjectsInRange(range: any): voidParameters:
| Name | Type | Description |
|---|---|---|
range | any | 范围。 |
Return Value:
- 无。
removeObject
Section titled “removeObject”移除与给定对象相等的元素。
removeObject(object: any): voidParameters:
| Name | Type | Description |
|---|---|---|
object | any | 要移除的对象。 |
Return Value:
- 无。
removeObjectsInArray
Section titled “removeObjectsInArray”移除与数组中元素相等的所有元素。
removeObjectsInArray(array: NSArray): voidParameters:
| Name | Type | Description |
|---|---|---|
array | NSArray | 要移除的元素所在数组。 |
Return Value:
- 无。
removeAllObjects
Section titled “removeAllObjects”清空有序集。
removeAllObjects(): voidReturn Value:
- 无。
replaceObjectAtIndexWithObject
Section titled “replaceObjectAtIndexWithObject”替换指定下标的元素。
replaceObjectAtIndexWithObject(idx: number, object: any): voidParameters:
| Name | Type | Description |
|---|---|---|
idx | number | 下标。 |
object | any | 新元素。 |
Return Value:
- 无。
replaceObjectsInRangeWithObjectsCount
Section titled “replaceObjectsInRangeWithObjectsCount”用 C 数组与长度替换范围内元素。
replaceObjectsInRangeWithObjectsCount(range: any, objects: any, count: number): voidParameters:
| Name | Type | Description |
|---|---|---|
range | any | 范围。 |
objects | any | 新元素序列。 |
count | number | 个数。 |
Return Value:
- 无。
replaceObjectsAtIndexesWithObjects
Section titled “replaceObjectsAtIndexesWithObjects”按索引集替换为给定数组中的元素。
replaceObjectsAtIndexesWithObjects(indexes: NSIndexSet, objects: NSArray): voidParameters:
| Name | Type | Description |
|---|---|---|
indexes | NSIndexSet | 下标集合。 |
objects | NSArray | 新元素数组。 |
Return Value:
- 无。
setObjectAtIndex
Section titled “setObjectAtIndex”在指定下标设置元素。
setObjectAtIndex(obj: any, idx: number): voidParameters:
| Name | Type | Description |
|---|---|---|
obj | any | 新元素。 |
idx | number | 下标。 |
Return Value:
- 无。
setObjectAtIndexedSubscript
Section titled “setObjectAtIndexedSubscript”下标形式设置元素。
setObjectAtIndexedSubscript(obj: any, idx: number): voidParameters:
| Name | Type | Description |
|---|---|---|
obj | any | 新元素。 |
idx | number | 下标。 |
Return Value:
- 无。
exchangeObjectAtIndexWithObjectAtIndex
Section titled “exchangeObjectAtIndexWithObjectAtIndex”交换两个下标的元素。
exchangeObjectAtIndexWithObjectAtIndex(idx1: number, idx2: number): voidParameters:
| Name | Type | Description |
|---|---|---|
idx1 | number | 下标一。 |
idx2 | number | 下标二。 |
Return Value:
- 无。
moveObjectsAtIndexesToIndex
Section titled “moveObjectsAtIndexesToIndex”将索引集对应元素移动到新下标。
moveObjectsAtIndexesToIndex(indexes: NSIndexSet, idx: number): voidParameters:
| Name | Type | Description |
|---|---|---|
indexes | NSIndexSet | 要移动的元素下标集合。 |
idx | number | 目标下标。 |
Return Value:
- 无。
unionOrderedSet
Section titled “unionOrderedSet”与另一有序集取并集(结果写回自身)。
unionOrderedSet(other: NSOrderedSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSOrderedSet | 另一有序集。 |
Return Value:
- 无。
intersectOrderedSet
Section titled “intersectOrderedSet”与另一有序集取交集(结果写回自身)。
intersectOrderedSet(other: NSOrderedSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSOrderedSet | 另一有序集。 |
Return Value:
- 无。
minusOrderedSet
Section titled “minusOrderedSet”与另一有序集取差集(结果写回自身)。
minusOrderedSet(other: NSOrderedSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSOrderedSet | 另一有序集。 |
Return Value:
- 无。
unionSet
Section titled “unionSet”与另一集合取并集(结果写回自身)。
unionSet(other: NSSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSSet | 另一集合。 |
Return Value:
- 无。
intersectSet
Section titled “intersectSet”与另一集合取交集(结果写回自身)。
intersectSet(other: NSSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSSet | 另一集合。 |
Return Value:
- 无。
minusSet
Section titled “minusSet”与另一集合取差集(结果写回自身)。
minusSet(other: NSSet): voidParameters:
| Name | Type | Description |
|---|---|---|
other | NSSet | 另一集合。 |
Return Value:
- 无。