The following tables list the members exposed by SparseArray.
Name | Description | |
---|---|---|
SparseArray Constructor | Overloaded. |
Name | Description | |
---|---|---|
Count | Retruns the number of items contained in the collection. | |
IsSynchronized | Indicates whether this collection is synchronized. Always returns false. | |
Item | Indexer. | |
NonNullItems | Returns a new instance of enumerable that can be used to enumerate through only the non-null items in the collection. | |
SyncRoot | Returns an object that can be used to synchronize thread access. |
Name | Description | |
---|---|---|
InCalculatingScrollCount | Indicates whether the sparse array is currently in the process of calculating its scroll count. |
Name | Description | |
---|---|---|
Add | Adds the speicifed item at the end of the collection. | |
AddRange | Adds items in the specified collection to the end of the collection. | |
Clear | Removes all items from the array. | |
Compact | Removes data structures allocated for empty slots in the sparse array. | |
Contains | Returns true if the specified item is contained in the collection. | |
CopyTo | Overloaded. Copies all the elements from this collection to the specified array starting at index. | |
Expand | Expands the array to the new count. New count must be greater than or equal to the current count. This has the same logical effect as adding new count - current count number of null items at the end of the array. | |
GetEnumerator | Overloaded. Returns an instance of IEnumerator that can be used to enumerate through all the elements of this collection. | |
GetItem | Overloaded. Gets the item at the specified index. If the item at the specified index is null and createItemCallback parameter is non-null, it will call CreateItem on the callback to create it and set it on the array at the specified index. | |
GetScrollCount | Returns the scroll count. | |
GetScrollIndexOf | Overloaded. Gets the scroll index of the specified item. | |
GetVisibleCount | Returns the visible count. | |
GetVisibleIndexOf | Overloaded. Returns the visible index associted with the specified item. Item must be contained within the array. If the item is hidden, that is it's ScrollCount is 0, the this method returns -1. | |
IndexOf | Retruns the index of the specified item. | |
Insert | Inserts the specified item at the specified location in the array. | |
InsertRange | Inserts items in the specified collection to the collection at the specified index. | |
Move | Overloaded. Moves the specified item to a new location. | |
NotifyItemScrollCountChanged | Whenever a scroll count of an item contained within this collection is changed, the collection must be notified of the change. If not notified of such a change, behavior of various scroll and visible index related methods will be undefined. | |
Remove | Removes the specified item. If the item doesn't exist in the collection, it does nothing. | |
RemoveAt | Removes an item at the specified index. | |
RemoveRange | Removes count number of items starting at the specified index in the array. | |
Reverse | Overloaded. Reverses the order of items in the collection. | |
Sort | Overloaded. Sorts the array. | |
SortGeneric<T> | Sorts the array using generic array to achieve slightly better performance. | |
ToArray | Overloaded. Returns a new array containing all the elements of this collection. |
Name | Description | |
---|---|---|
DirtyScrollCountInfo | Dirties scroll count info for the whole collection so next time it will be re-calculated. | |
GetItemAtScrollIndex | Returns the item at the specified scroll index. This method returns null if the scroll index is out of bounds. | |
GetItemAtVisibleIndex | Returns the item at the specified visible index. This method returns null if the visible index is out of bounds. | |
GetItemAtVisibleIndexOffset | Returns offset'th visible item from startItem. StartItem can be hidden in which case it will start from the next visible item. Offset can be 0. If the resulting visible index is out of bounds, returns null. | |
GetItemContainingScrollIndex | Returns the item at the specified scroll index. This method returns null if the scroll index is out of bounds. | |
GetOwnerData | Returns the owner data of the item. Derived class can override GetOwnerData and SetOwnerData to support owner data without having to implement ISparseArrayItem interface on the items. | |
GetVisibleItems | Returns all the visible items. New items will be created to fill null slots via createItemCallback parameter if it's non-null. | |
OnItemCreated | Called when the sparese array creates an item by calling CreateItem on the ICreateItemCallback instance that gets passed into the method that initiates the creatio of the item (like GetItem method for example). | |
OnScrollCountChanged | Called by the sparse array whenever visible count or scroll count changes or is dirtied. Default implementation does nothing. This may get called multiple times for the same change as well as may get called even when the count doesn't change but is simply dirtied. | |
SetOwnerData | Sets the owner data on item. Derived class can override GetOwnerData and SetOwnerData to support owner data without having to implement ISparseArrayItem interface on the items. |