Stores a list of items where the are gaps between items; not every index in the array contains an element.
More...
|
| SparseArray () |
| Creates a new SparseArray with the default capacity. More...
|
|
| SparseArray (int capacity) |
| Creates a new SparseArray with the given capacity. More...
|
|
| SparseArray (IEnumerable< KeyValuePair< int, T >> enumerator) |
| Creates a new sparse array from the given enumerator. More...
|
|
void | Clear () |
| Clears out all elements inside of the SparseArray. More...
|
|
bool | Remove (int index) |
| Removes the element at the given index. More...
|
|
bool | ContainsKey (int index) |
| Checks to see if there is an element at the given index. More...
|
|
bool | TryGetValue (int key, out T value) |
| Gets the value associated with the specified key. More...
|
|
IEnumerator< KeyValuePair< int,
T > > | GetEnumerator () |
| Returns an enumerator that iterates through the collection. More...
|
|
Stores a list of items where the are gaps between items; not every index in the array contains an element.
Forge.Collections.SparseArray< T >.SparseArray |
( |
| ) |
|
Creates a new SparseArray with the default capacity.
Forge.Collections.SparseArray< T >.SparseArray |
( |
int |
capacity | ) |
|
Creates a new SparseArray with the given capacity.
- Parameters
-
capacity | The capacity to initialize with |
Forge.Collections.SparseArray< T >.SparseArray |
( |
IEnumerable< KeyValuePair< int, T >> |
enumerator | ) |
|
Creates a new sparse array from the given enumerator.
- Parameters
-
enumerator | The items to allocate the array from. |
void Forge.Collections.SparseArray< T >.Clear |
( |
| ) |
|
Clears out all elements inside of the SparseArray.
bool Forge.Collections.SparseArray< T >.ContainsKey |
( |
int |
index | ) |
|
Checks to see if there is an element at the given index.
- Parameters
-
- Returns
- True if there is a contained element, false otherwise.
IEnumerator<KeyValuePair<int, T> > Forge.Collections.SparseArray< T >.GetEnumerator |
( |
| ) |
|
Returns an enumerator that iterates through the collection.
bool Forge.Collections.SparseArray< T >.Remove |
( |
int |
index | ) |
|
Removes the element at the given index.
- Parameters
-
index | The index of the element to remove |
- Returns
- If an element was removed
bool Forge.Collections.SparseArray< T >.TryGetValue |
( |
int |
key, |
|
|
out T |
value |
|
) |
| |
Gets the value associated with the specified key.
- Parameters
-
key | The key whose value to get. |
value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
- Returns
- true if the object that implements T:System.Collections.Generic.IDictionary`2 contains an element with the specified key; otherwise, false.
T Forge.Collections.SparseArray< T >.this[int index] |
|
getset |
Gets or sets the element at the given index.
- Parameters
-
- Returns
- If getting, then the value at the given index.
The documentation for this class was generated from the following file:
- Forge.Collections/SparseArray.cs