Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ListExtensions

    Extensions to IList<T>.

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

    Methods

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

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

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

    The list to add to.

    IEnumerable<T> collection

    The collection whose elements should be added to the end of the 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
    ArgumentNullException

    list or collection is null.

    IntroSort<T>(IList<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>(this 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>(this IList<T> list, IComparer<T> comparer)
    Parameters
    Type Name Description
    IList<T> list

    this IList<T>

    IComparer<T> comparer

    The IComparer<T> to use for the sort.

    Type Parameters
    Name Description
    T

    Sort<T>(IList<T>)

    If the underlying type is List<T>, calls Sort(). If not, uses TimSort<T>(IList<T>)

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

    this IList<T>

    Type Parameters
    Name Description
    T

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

    If the underlying type is List<T>, calls Sort(IComparer<T>). 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
    IList<T> list

    this IList<T>

    IComparer<T> comparer

    the comparer to use for the sort

    Type Parameters
    Name Description
    T

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

    If the underlying type is List<T>, calls Sort(IComparer<T>). 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
    IList<T> list

    this IList<T>

    Comparison<T> comparison

    the comparison function to use for the sort

    Type Parameters
    Name Description
    T

    TimSort<T>(IList<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>(this 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>(this IList<T> list, IComparer<T> comparer)
    Parameters
    Type Name Description
    IList<T> list

    this IList<T>

    IComparer<T> comparer

    The IComparer<T> to use for the sort.

    Type Parameters
    Name Description
    T
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.