Class ListExtensions
Inheritance
Namespace: Lucene.Net.Support
Assembly: Lucene.Net.dll
Syntax
public static class ListExtensions : object
Methods
| Improve this Doc View SourceAddRange<T>(IList<T>, IEnumerable<T>)
Declaration
public static void AddRange<T>(this IList<T> list, IEnumerable<T> values)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | |
IEnumerable<T> | values |
Type Parameters
Name | Description |
---|---|
T |
BinarySearch<T>(IList<T>, T)
Performs a binary search for the specified element in the specified sorted list. The list needs to be already sorted in natural sorting order. Searching in an unsorted array has an undefined result. It's also undefined which element is found if there are multiple occurrences of the same element.
Declaration
public static int BinarySearch<T>(this IList<T> list, T item)
where T : IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | The sorted list to search. |
T | item | The element to find. |
Returns
Type | Description |
---|---|
System. |
The non-negative index of the element, or a negative index which
is the |
Type Parameters
Name | Description |
---|---|
T | The element type. |
BinarySearch<T>(IList<T>, T, IComparer<T>)
Performs a binary search for the specified element in the specified
sorted list using the specified comparator. The list needs to be already
sorted according to the comparer
passed. Searching in an unsorted array
has an undefined result. It's also undefined which element is found if
there are multiple occurrences of the same element.
Declaration
public static int BinarySearch<T>(this IList<T> list, T item, IComparer<T> comparer)
where T : IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | The sorted |
T | item | The element to find. |
IComparer<T> | comparer | The comparer. If the comparer is |
Returns
Type | Description |
---|---|
System. |
the non-negative index of the element, or a negative index which
is the |
Type Parameters
Name | Description |
---|---|
T | The element type. |
IntroSort<T>(IList<T>)
Sorts the given
Declaration
public static void IntroSort<T>(this IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
Type Parameters
Name | Description |
---|---|
T |
IntroSort<T>(IList<T>, IComparer<T>)
Sorts the given
Declaration
public static void IntroSort<T>(this IList<T> list, IComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
IComparer<T> | comparer | The |
Type Parameters
Name | Description |
---|---|
T |
Shuffle<T>(IList<T>)
Shuffles an
Declaration
public static void Shuffle<T>(this IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | This |
Type Parameters
Name | Description |
---|---|
T |
Shuffle<T>(IList<T>, Random)
Shuffles an random
instance.
Declaration
public static void Shuffle<T>(this IList<T> list, Random random)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | This |
Random | random |
Type Parameters
Name | Description |
---|---|
T |
Sort<T>(IList<T>)
If the underlying type is
Declaration
public static void Sort<T>(this IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
Type Parameters
Name | Description |
---|---|
T |
Sort<T>(IList<T>, Comparison<T>)
If the underlying type is
Declaration
public static void Sort<T>(this IList<T> list, Comparison<T> comparison)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
Comparison<T> | comparison | the comparison function to use for the sort |
Type Parameters
Name | Description |
---|---|
T |
Sort<T>(IList<T>, IComparer<T>)
If the underlying type is
Declaration
public static void Sort<T>(this IList<T> list, IComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
IComparer<T> | comparer | the comparer to use for the sort |
Type Parameters
Name | Description |
---|---|
T |
SubList<T>(IList<T>, Int32, Int32)
Declaration
public static IList<T> SubList<T>(this IList<T> list, int fromIndex, int toIndex)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | |
System. |
fromIndex | |
System. |
toIndex |
Returns
Type | Description |
---|---|
IList<T> |
Type Parameters
Name | Description |
---|---|
T |
Swap<T>(IList<T>, Int32, Int32)
Declaration
public static void Swap<T>(this IList<T> list, int indexA, int indexB)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | |
System. |
indexA | |
System. |
indexB |
Type Parameters
Name | Description |
---|---|
T |
TimSort<T>(IList<T>)
Sorts the given
Declaration
public static void TimSort<T>(this IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
Type Parameters
Name | Description |
---|---|
T |
TimSort<T>(IList<T>, IComparer<T>)
Sorts the given
Declaration
public static void TimSort<T>(this IList<T> list, IComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this |
IComparer<T> | comparer | The |
Type Parameters
Name | Description |
---|---|
T |