Class CollectionUtil
Methods for manipulating (sorting) collections. Sort methods work directly on the supplied lists and don't copy to/from arrays before/after. For medium size collections as used in the Lucene indexer that is much more efficient.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public static class CollectionUtil
Methods
IntroSort<T>(IList<T>)
Sorts the given random access IList<T> in natural order. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.
Declaration
public static void IntroSort<T>(IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | This IList<T> |
Type Parameters
Name | Description |
---|---|
T |
IntroSort<T>(IList<T>, IComparer<T>)
Sorts the given IList<T> using the IComparer<T>. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.
Declaration
public static void IntroSort<T>(IList<T> list, IComparer<T> comp)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | This IList<T> |
IComparer<T> | comp | The IComparer<T> to use for the sort. |
Type Parameters
Name | Description |
---|---|
T |
TimSort<T>(IList<T>)
Sorts the given IList<T> in natural order. This method uses the Tim sort algorithm, but falls back to binary sort for small lists.
Declaration
public static void TimSort<T>(IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | This IList<T> |
Type Parameters
Name | Description |
---|---|
T |
TimSort<T>(IList<T>, IComparer<T>)
Sorts the given IList<T> using the IComparer<T>. This method uses the Tim sort algorithm, but falls back to binary sort for small lists.
Declaration
public static void TimSort<T>(IList<T> list, IComparer<T> comp)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list | this IList<T> |
IComparer<T> | comp | The IComparer<T> to use for the sort. |
Type Parameters
Name | Description |
---|---|
T |