• API

    Show / Hide Table of Contents

    Class ListExtensions

    Extensions to System.Collections.Generic.IList<T>.

    Inheritance
    System.Object
    ListExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public static class ListExtensions

    Methods

    | Improve this Doc View Source

    AddRange<T>(IList<T>, IEnumerable<T>)

    Adds the elements of the specified collection to the end of the System.Collections.Generic.IList<T>.

    Declaration
    public static void AddRange<T>(this IList<T> list, IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    The list to add to.

    System.Collections.Generic.IEnumerable<T> collection

    The collection whose elements should be added to the end of the System.Collections.Generic.IList<T>. The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.

    Type Parameters
    Name Description
    T

    The element type.

    Exceptions
    Type Condition
    System.ArgumentNullException

    list or collection is null.

    | Improve this Doc View Source

    IntroSort<T>(IList<T>)

    Sorts the given System.Collections.Generic.IList<T> using the System.Collections.Generic.IComparer<T>. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.

    Declaration
    public static void IntroSort<T>(this IList<T> list)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    IntroSort<T>(IList<T>, IComparer<T>)

    Sorts the given System.Collections.Generic.IList<T> using the System.Collections.Generic.IComparer<T>. This method uses the intro sort algorithm, but falls back to insertion sort for small lists.

    Declaration
    public static void IntroSort<T>(this IList<T> list, IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    System.Collections.Generic.IComparer<T> comparer

    The System.Collections.Generic.IComparer<T> to use for the sort.

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Sort<T>(IList<T>)

    If the underlying type is System.Collections.Generic.List<T>, calls System.Collections.Generic.List`1.Sort. If not, uses TimSort<T>(IList<T>)

    Declaration
    public static void Sort<T>(this IList<T> list)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Sort<T>(IList<T>, IComparer<T>)

    If the underlying type is System.Collections.Generic.List<T>, calls System.Collections.Generic.List`1.Sort(System.Collections.Generic.IComparer{`0}). If not, uses TimSort<T>(IList<T>, IComparer<T>)

    Declaration
    public static void Sort<T>(this IList<T> list, IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    System.Collections.Generic.IComparer<T> comparer

    the comparer to use for the sort

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Sort<T>(IList<T>, Comparison<T>)

    If the underlying type is System.Collections.Generic.List<T>, calls System.Collections.Generic.List`1.Sort(System.Collections.Generic.IComparer{`0}). If not, uses TimSort<T>(IList<T>, IComparer<T>)

    Declaration
    public static void Sort<T>(this IList<T> list, Comparison<T> comparison)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    System.Comparison<T> comparison

    the comparison function to use for the sort

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    TimSort<T>(IList<T>)

    Sorts the given System.Collections.Generic.IList<T> using the System.Collections.Generic.IComparer<T>. This method uses the Tim sort algorithm, but falls back to binary sort for small lists.

    Declaration
    public static void TimSort<T>(this IList<T> list)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    TimSort<T>(IList<T>, IComparer<T>)

    Sorts the given System.Collections.Generic.IList<T> using the System.Collections.Generic.IComparer<T>. This method uses the Tim sort algorithm, but falls back to binary sort for small lists.

    Declaration
    public static void TimSort<T>(this IList<T> list, IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<T> list

    this System.Collections.Generic.IList<T>

    System.Collections.Generic.IComparer<T> comparer

    The System.Collections.Generic.IComparer<T> to use for the sort.

    Type Parameters
    Name Description
    T
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)