Show / Hide Table of Contents

    Class Collections

    Inheritance
    System.Object
    Collections
    Namespace: Lucene.Net.Support
    Assembly: Lucene.Net.dll
    Syntax
    public static class Collections : object

    Methods

    | Improve this Doc View Source

    EmptyList<T>()

    Declaration
    public static IList<T> EmptyList<T>()
    Returns
    Type Description
    IList<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    EmptyMap<TKey, TValue>()

    Declaration
    public static IDictionary<TKey, TValue> EmptyMap<TKey, TValue>()
    Returns
    Type Description
    IDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    Equals(Object, Object)

    A helper method to recursively determine equality based on the values of the collection and all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static bool Equals(object objA, object objB)
    Parameters
    Type Name Description
    System.Object objA
    System.Object objB
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals<T>(IList<T>, IList<T>)

    The same implementation of Equals from Java's AbstractList (the default implementation for all lists)

    This algorithm depends on the order of the items in the list. It is recursive and will determine equality based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static bool Equals<T>(IList<T> listA, IList<T> listB)
    Parameters
    Type Name Description
    IList<T> listA
    IList<T> listB
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Equals<T>(ISet<T>, ISet<T>)

    The same implementation of Equals from Java's AbstractSet (the default implementation for all sets)

    This algoritm does not depend on the order of the items in the set. It is recursive and will determine equality based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static bool Equals<T>(ISet<T> setA, ISet<T> setB)
    Parameters
    Type Name Description
    ISet<T> setA
    ISet<T> setB
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Equals<TKey, TValue>(IDictionary<TKey, TValue>, IDictionary<TKey, TValue>)

    This is the same implemenation of Equals from Java's AbstractMap (the default implementation of all dictionaries)

    This algoritm does not depend on the order of the items in the dictionary. It is recursive and will determine equality based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static bool Equals<TKey, TValue>(IDictionary<TKey, TValue> dictionaryA, IDictionary<TKey, TValue> dictionaryB)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> dictionaryA
    IDictionary<TKey, TValue> dictionaryB
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    GetHashCode(Object)

    This method generally assists with the recursive GetHashCode() that builds a hash code based on all of the values in a collection including any nested collections (lists, sets, arrays, and dictionaries).

    Note this currently only supports , , and .

    Declaration
    public static int GetHashCode(object obj)
    Parameters
    Type Name Description
    System.Object obj

    the object to build the hash code for

    Returns
    Type Description
    System.Int32

    a value that represents the unique state of all of the values and nested collection values in the object, provided the main object itself is a collection, otherwise calls on the object that is passed.

    | Improve this Doc View Source

    GetHashCode<T>(IList<T>)

    The same implementation of GetHashCode from Java's AbstractList (the default implementation for all lists).

    This algorithm depends on the order of the items in the list. It is recursive and will build the hash code based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static int GetHashCode<T>(IList<T> list)
    Parameters
    Type Name Description
    IList<T> list
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    GetHashCode<T>(ISet<T>)

    The same implementation of GetHashCode from Java's AbstractSet (the default implementation for all sets)

    This algorithm does not depend on the order of the items in the set. It is recursive and will build the hash code based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static int GetHashCode<T>(ISet<T> set)
    Parameters
    Type Name Description
    ISet<T> set
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    GetHashCode<TKey, TValue>(IDictionary<TKey, TValue>)

    The same implementation of GetHashCode from Java's AbstractMap (the default implementation for all dictionaries)

    This algoritm does not depend on the order of the items in the dictionary. It is recursive and will build the hash code based on the values of all nested collections.

    Note this operation currently only supports , , and .

    Declaration
    public static int GetHashCode<TKey, TValue>(IDictionary<TKey, TValue> dictionary)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> dictionary
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    NewSetFromMap<T, S>(IDictionary<T, Nullable<Boolean>>)

    Declaration
    public static ISet<T> NewSetFromMap<T, S>(IDictionary<T, bool?> map)
    Parameters
    Type Name Description
    IDictionary<T, System.Nullable<System.Boolean>> map
    Returns
    Type Description
    ISet<T>
    Type Parameters
    Name Description
    T
    S
    | Improve this Doc View Source

    Reverse<T>(IList<T>)

    Declaration
    public static void Reverse<T>(IList<T> list)
    Parameters
    Type Name Description
    IList<T> list
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ReverseOrder<T>()

    Declaration
    public static IComparer<T> ReverseOrder<T>()
    Returns
    Type Description
    IComparer<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ReverseOrder<T>(IComparer<T>)

    Declaration
    public static IComparer<T> ReverseOrder<T>(IComparer<T> cmp)
    Parameters
    Type Name Description
    IComparer<T> cmp
    Returns
    Type Description
    IComparer<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Shuffle<T>(IList<T>)

    Declaration
    public static void Shuffle<T>(IList<T> list)
    Parameters
    Type Name Description
    IList<T> list
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Shuffle<T>(IList<T>, Random)

    Declaration
    public static void Shuffle<T>(IList<T> list, Random random)
    Parameters
    Type Name Description
    IList<T> list
    Random random
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Singleton<T>(T)

    Declaration
    public static ISet<T> Singleton<T>(T o)
    Parameters
    Type Name Description
    T o
    Returns
    Type Description
    ISet<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    SingletonMap<TKey, TValue>(TKey, TValue)

    Declaration
    public static IDictionary<TKey, TValue> SingletonMap<TKey, TValue>(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Returns
    Type Description
    IDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    Swap<T>(IList<T>, Int32, Int32)

    Declaration
    public static void Swap<T>(IList<T> list, int index1, int index2)
    Parameters
    Type Name Description
    IList<T> list
    System.Int32 index1
    System.Int32 index2
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ToString(Object)

    This is a helper method that assists with recursively building a string of the current collection and all nested collections.

    Declaration
    public static string ToString(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToString(Object, CultureInfo)

    This is a helper method that assists with recursively building a string of the current collection and all nested collections, plus the ability to specify culture for formatting of nested numbers and dates. Note that this overload will change the culture of the current thread.

    Declaration
    public static string ToString(object obj, CultureInfo culture)
    Parameters
    Type Name Description
    System.Object obj
    CultureInfo culture
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToString<T>(ICollection<T>)

    This is the same implementation of ToString from Java's AbstractCollection (the default implementation for all sets and lists)

    Declaration
    public static string ToString<T>(ICollection<T> collection)
    Parameters
    Type Name Description
    ICollection<T> collection
    Returns
    Type Description
    System.String
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ToString<T>(ICollection<T>, CultureInfo)

    This is the same implementation of ToString from Java's AbstractCollection (the default implementation for all sets and lists), plus the ability to specify culture for formatting of nested numbers and dates. Note that this overload will change the culture of the current thread.

    Declaration
    public static string ToString<T>(ICollection<T> collection, CultureInfo culture)
    Parameters
    Type Name Description
    ICollection<T> collection
    CultureInfo culture
    Returns
    Type Description
    System.String
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    ToString<TKey, TValue>(IDictionary<TKey, TValue>)

    This is the same implementation of ToString from Java's AbstractMap (the default implementation for all dictionaries)

    Declaration
    public static string ToString<TKey, TValue>(IDictionary<TKey, TValue> dictionary)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> dictionary
    Returns
    Type Description
    System.String
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    ToString<TKey, TValue>(IDictionary<TKey, TValue>, CultureInfo)

    This is the same implementation of ToString from Java's AbstractMap (the default implementation for all dictionaries), plus the ability to specify culture for formatting of nested numbers and dates. Note that this overload will change the culture of the current thread.

    Declaration
    public static string ToString<TKey, TValue>(IDictionary<TKey, TValue> dictionary, CultureInfo culture)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> dictionary
    CultureInfo culture
    Returns
    Type Description
    System.String
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    UnmodifiableList<T>(IList<T>)

    Declaration
    public static IList<T> UnmodifiableList<T>(IList<T> list)
    Parameters
    Type Name Description
    IList<T> list
    Returns
    Type Description
    IList<T>
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    UnmodifiableMap<TKey, TValue>(IDictionary<TKey, TValue>)

    Declaration
    public static IDictionary<TKey, TValue> UnmodifiableMap<TKey, TValue>(IDictionary<TKey, TValue> d)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> d
    Returns
    Type Description
    IDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue
    | Improve this Doc View Source

    UnmodifiableSet<T>(ISet<T>)

    Declaration
    public static ISet<T> UnmodifiableSet<T>(ISet<T> list)
    Parameters
    Type Name Description
    ISet<T> list
    Returns
    Type Description
    ISet<T>
    Type Parameters
    Name Description
    T
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)