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 | |
---|---|---|
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
GetScrollCount | Returns the scroll count. | |
GetScrollIndexOf | Overloaded. Gets the scroll index of the specified item. | |
GetVisibleCount | Returns the visible count. | |
GetVisibleIndexOf | 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. | |
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. | |
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. |