Class IndexExtensions
- Namespace
- Garyon.Extensions
- Assembly
- Garyon.dll
Provides extension functions for the Index type.
public static class IndexExtensions
- Inheritance
-
IndexExtensions
- Inherited Members
Methods
GetOffset(Index, Array, int)
Gets the offset for the provided dimension in an array.
[ExcludeFromCodeCoverage]
public static int GetOffset(this Index index, Array array, int dimension)
Parameters
indexIndexThe index in the dimension.
arrayArrayThe array to get the offset from.
dimensionintThe dimension within the array.
Returns
- int
The offset.
GetOffset<T>(Index, ICollection<T>)
Gets the offset for the provided dimension in a collection.
[ExcludeFromCodeCoverage]
public static int GetOffset<T>(this Index index, ICollection<T> collection)
Parameters
indexIndexThe index in the collection.
collectionICollection<T>The collection to get the offset from.
Returns
- int
The offset.
Type Parameters
T
GetOffset<T>(Index, IEnumerable<T>)
Gets the offset for the provided dimension in a collection.
[ExcludeFromCodeCoverage]
public static int GetOffset<T>(this Index index, IEnumerable<T> collection)
Parameters
indexIndexThe index in the collection.
collectionIEnumerable<T>The collection to get the offset from.
Returns
- int
The offset.
Type Parameters
T
GetOffset<T>(Index, T[])
Gets the offset for the provided dimension in a single-dimensional array.
[ExcludeFromCodeCoverage]
public static int GetOffset<T>(this Index index, T[] array)
Parameters
indexIndexThe index in the array.
arrayT[]The array to get the offset from.
Returns
- int
The offset.
Type Parameters
T
Invert(Index)
Inverts the index to reflect the respective index symmetric to the middle of the collection.
public static Index Invert(this Index index)
Parameters
indexIndexThe index to invert.
Returns
- Index
The inverted index.