Platforms to show: All Mac Windows Linux Cross-Platform
NSIndexSetMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 9.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
dim n as new NSIndexSetMBS(5,6) // 5, 6, 7, 8, 9, 10
MsgBox str(n.firstIndex)+" "+str(n.lastIndex)
This collection is referred to as a index set.
You use index sets in your code to store indexes into some other data structure. For example, given an array, you could use an index set to identify a subset of objects in that array.
Each index value can appear only once in the index set. This is an important concept to understand and is why you would not use index sets to store an arbitrary collection of integer values. To illustrate how this works, if you created an NSIndexSet object with the values 4, 5, 2, and 5, the resulting set would only have the values 4, 5, and 2 in it. Because index values are always maintained in sorted order, the actual order of the values when you created the set would be 2, 4, and then 5.
In most cases, using an index set is more efficient than storing a collection of individual integers. Internally, the NSIndexSet class represents indexes using ranges. For maximum performance and efficiency, overlapping ranges in an index set are automatically coalesced—that is, ranges merge rather than overlap. Thus, the more contiguous the indexes in the set, the fewer ranges are required to specify those indexes.
You must not subclass the NSIndexSet class.
The mutable subclass of NSIndexSet is NSMutableIndexSet.
- property Handle as Integer
- 21 methods
- method Constructor
- method Constructor(index as Integer)
- method Constructor(indexes as NSIndexSetMBS)
- method Constructor(StartIndex as Integer, Length as Integer)
- method containsIndex(index as Integer) as boolean
- method containsIndexes(indexes as NSIndexSetMBS) as boolean
- method containsIndexesInRange(StartIndex as Integer, Length as Integer) as boolean
- method copy as NSIndexSetMBS
- method count as Integer
- method countOfIndexesInRange(StartIndex as Integer, Length as Integer) as Integer
- method firstIndex as Integer
- method indexGreaterThanIndex(index as Integer) as Integer
- method indexGreaterThanOrEqualToIndex(index as Integer) as Integer
- method indexLessThanIndex(index as Integer) as Integer
- method indexLessThanOrEqualToIndex(index as Integer) as Integer
- method intersectsIndexesInRange(StartIndex as Integer, Length as Integer) as boolean
- method isEqualToIndexSet(other as NSIndexSetMBS) as boolean
- method lastIndex as Integer
- method mutableCopy as NSMutableIndexSetMBS
- method Operator_Convert as string
- method Values as Integer()
- 3 shared methods
- shared method indexSet as NSIndexSetMBS
- shared method indexSetWithIndex(index as Integer) as NSIndexSetMBS
- shared method indexSetWithIndexesInRange(StartIndex as Integer, Length as Integer) as NSIndexSetMBS
Sub classes:
Some methods using this class:
- NSCollectionViewMBS.reloadSections(sections as NSIndexSetMBS)
- NSOutlineViewMBS.removeItemsAtIndexes(indexes as NSIndexSetMBS, Parent as NSOutlineViewItemMBS, animationOptions as Integer)
- NSOutlineViewMBS.removeRowsAtIndexes(indexes as NSIndexSetMBS, animationOptions as Integer)
- NSTableViewMBS.hideRowsAtIndexes(indexes as NSIndexSetMBS, animationOptions as Integer)
- NSTableViewMBS.noteHeightOfRowsWithIndexesChanged(indexSet as NSIndexSetMBS)
- NSTableViewMBS.selectColumnIndexes(indexes as NSIndexSetMBS, extend as boolean)
- NSTableViewMBS.selectedColumnIndexes as NSIndexSetMBS
- NSTableViewMBS.selectRowIndexes(indexes as NSIndexSetMBS, extend as boolean)
- NSTableViewMBS.unhideRowsAtIndexes(indexes as NSIndexSetMBS, animationOptions as Integer)
- PHCollectionListChangeRequestMBS.insertChildCollections(collections() as PHCollectionMBS, indexes as NSIndexSetMBS)
Some properties using for this class:
- ICScannerFunctionalUnitMBS.preferredResolutions as NSIndexSetMBS
- ICScannerFunctionalUnitMBS.preferredScaleFactors as NSIndexSetMBS
- ICScannerFunctionalUnitMBS.supportedBitDepths as NSIndexSetMBS
- ICScannerFunctionalUnitMBS.supportedDocumentTypes as NSIndexSetMBS
- ICScannerFunctionalUnitMBS.supportedResolutions as NSIndexSetMBS
- ICScannerFunctionalUnitMBS.supportedScaleFactors as NSIndexSetMBS
- IKCameraDeviceViewMBS.selectedIndexes as NSIndexSetMBS
- PHFetchResultChangeDetailsMBS.changedIndexes as NSIndexSetMBS
- PHFetchResultChangeDetailsMBS.insertedIndexes as NSIndexSetMBS
- PHFetchResultChangeDetailsMBS.removedIndexes as NSIndexSetMBS
Some events using this class:
- DesktopNSTableControlMBS.draggingSessionWillBegin(session as NSDraggingSessionMBS, screenPoint as NSPointMBS, rowIndexes as NSIndexSetMBS)
- DesktopNSTableControlMBS.namesOfPromisedFilesDroppedAtDestination(dropDestination as folderItem, DraggedRowsWithIndexes as NSIndexSetMBS) as string()
- DesktopNSTableControlMBS.writeRowsWithIndexes(rowIndexes as NSIndexSetMBS, pboard as NSPasteboardMBS) as boolean
- IKImageBrowserViewControlMBS.moveItemsAtIndexes(indexes as NSIndexSetMBS, destinationIndex as Integer) as boolean
- IKImageBrowserViewMBS.moveItemsAtIndexes(indexes as NSIndexSetMBS, destinationIndex as Integer) as boolean
- IKImageBrowserViewMBS.removeItemsAtIndexes(indexes as NSIndexSetMBS)
- NSTableControlMBS.draggingSessionWillBegin(session as NSDraggingSessionMBS, screenPoint as NSPointMBS, rowIndexes as NSIndexSetMBS)
- NSTableControlMBS.namesOfPromisedFilesDroppedAtDestination(dropDestination as folderItem, DraggedRowsWithIndexes as NSIndexSetMBS) as string()
- NSTableControlMBS.selectionIndexesForProposedSelection(proposedSelectionIndexes as NSIndexSetMBS) as NSIndexSetMBS
- NSTableControlMBS.writeRowsWithIndexes(rowIndexes as NSIndexSetMBS, pboard as NSPasteboardMBS) as boolean
Some examples using this class:
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /MacControls/Listbox and TableView Demos/NSOutlineView/Disk Browser
- /MacFrameworks/IKImageBrowser/IKImageBrowser
- /MacFrameworks/IKImageBrowser/IKImageBrowser Control
- /MacFrameworks/IKImageBrowser/IKImageBrowser Groups
- /MacFrameworks/IKImageBrowser/IKImageBrowser Scroll
Blog Entries
The items on this page are in the following plugins: MBS MacBase Plugin.
NSIndexPathMBS - NSInputStreamMBS
