Show / Hide Table of Contents

    Class EquatableList<T>

    Represents a strongly typed list of objects that can be accessed by index. Provides methods to manipulate lists. Also provides functionality to compare lists against each other through an implementations of , or to wrap an existing list to use the same comparison logic as this one while not affecting any of its other functionality.

    Inheritance
    System.Object
    EquatableList<T>
    Implements
    IEquatable<IList<T>>
    Namespace: Lucene.Net.Support
    Assembly: Lucene.Net.dll
    Syntax
    public class EquatableList<T> : IList<T>, IEquatable<IList<T>>
    Type Parameters
    Name Description
    T

    The type of elements in the list.

    Constructors

    | Improve this Doc View Source

    EquatableList()

    Initializes a new instance of the EquatableList<T> class that is empty and has the default initial capacity.

    Declaration
    public EquatableList()
    | Improve this Doc View Source

    EquatableList(IEnumerable<T>)

    Initializes a new instance of the EquatableList<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.

    Declaration
    public EquatableList(IEnumerable<T> collection)
    Parameters
    Type Name Description
    IEnumerable<T> collection

    The collection whose elements are copied to the new list.

    | Improve this Doc View Source

    EquatableList(IList<T>, Boolean)

    Initializes a new instance of EquatableList<T>.

    If the wrap parameter is true, the collection is used as is without doing a copy operation. Otherwise, the collection is copied (which is the same operation as the EquatableList(IEnumerable<T>) overload).

    The internal collection is used for all operations except for Equals(Object), GetHashCode(), and ToString(), which are all based on deep analysis of this collection and any nested collections.

    Declaration
    public EquatableList(IList<T> collection, bool wrap)
    Parameters
    Type Name Description
    IList<T> collection

    The collection that will either be wrapped or copied depending on the value of wrap.

    System.Boolean wrap

    true to wrap an existing without copying, or false to copy the collection into a new .

    | Improve this Doc View Source

    EquatableList(Int32)

    Initializes a new instance of the EquatableList<T> class that is empty and has the specified initial capacity.

    Declaration
    public EquatableList(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity

    The number of elements that the new list can initially store.

    Properties

    | Improve this Doc View Source

    Count

    Gets the number of elements contained in the EquatableList<T>.

    Declaration
    public virtual int Count { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    IsReadOnly

    Gets a value indicating whether the EquatableList<T> is read-only.

    Declaration
    public virtual bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Item[Int32]

    Gets or sets the element at the specified index.

    Declaration
    public virtual T this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the element to get or set.

    Property Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    Add(T)

    Adds an object to the end of the EquatableList<T>.

    Declaration
    public virtual void Add(T item)
    Parameters
    Type Name Description
    T item

    The object to be added to the end of the EquatableList<T>. The value can be null for reference types.

    | Improve this Doc View Source

    Clear()

    Removes all items from the EquatableList<T>.

    Declaration
    public virtual void Clear()
    | Improve this Doc View Source

    Clone()

    Clones the EquatableList<T>.

    Declaration
    public virtual object Clone()
    Returns
    Type Description
    System.Object

    A new shallow clone of this EquatableList<T>.

    Remarks

    This is a shallow clone.

    | Improve this Doc View Source

    Contains(T)

    Determines whether the EquatableList<T> contains a specific value.

    Declaration
    public virtual bool Contains(T item)
    Parameters
    Type Name Description
    T item

    The object to locate in the EquatableList<T>.

    Returns
    Type Description
    System.Boolean

    true if the Object is found in the EquatableList<T>; otherwise, false.

    | Improve this Doc View Source

    CopyTo(T[], Int32)

    Copies the entire EquatableList<T> to a compatible one-dimensional array, starting at the specified index of the target array.

    Declaration
    public virtual void CopyTo(T[] array, int arrayIndex)
    Parameters
    Type Name Description
    T[] array

    The one-dimensional that is the destination of the elements copied from EquatableList<T>. The Array must have zero-based indexing.

    System.Int32 arrayIndex

    The zero-based index in array at which copying begins.

    | Improve this Doc View Source

    Equals(IList<T>)

    Compares this sequence to another implementation, returning true if they are equal, false otherwise.

    The comparison takes into consideration any values in this collection and values of any nested collections, but does not take into consideration the data type. Therefore, EquatableList<T> can equal any with the exact same values in the same order.

    Declaration
    public virtual bool Equals(IList<T> other)
    Parameters
    Type Name Description
    IList<T> other

    The other implementation to compare against.

    Returns
    Type Description
    System.Boolean

    true if the sequence in other is the same as this one.

    | Improve this Doc View Source

    Equals(Object)

    If the object passed implements , compares this sequence to other, returning true if they are equal, false otherwise.

    The comparison takes into consideration any values in this collection and values of any nested collections, but does not take into consideration the data type. Therefore, EquatableList<T> can equal any with the exact same values in the same order.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    System.Object other

    The other object to compare against.

    Returns
    Type Description
    System.Boolean

    true if the sequence in other is the same as this one.

    | Improve this Doc View Source

    GetEnumerator()

    Returns an enumerator that iterates through the EquatableList<T>.

    Declaration
    public virtual IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    An for the EquatableList<T>.

    | Improve this Doc View Source

    GetHashCode()

    Returns the hash code value for this list.

    The hash code determination takes into consideration any values in this collection and values of any nested collections, but does not take into consideration the data type. Therefore, the hash codes will be exactly the same for this EquatableList<T> and another (including arrays) with the same values in the same order.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    the hash code value for this list

    | Improve this Doc View Source

    IndexOf(T)

    Determines the index of a specific item in the EquatableList<T>.

    Declaration
    public virtual int IndexOf(T item)
    Parameters
    Type Name Description
    T item

    The object to locate in the EquatableList<T>.

    Returns
    Type Description
    System.Int32

    The index of item if found in the list; otherwise, -1.

    | Improve this Doc View Source

    Insert(Int32, T)

    Inserts an item to the EquatableList<T> at the specified index.

    Declaration
    public virtual void Insert(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index at which item should be inserted.

    T item

    The object to insert into the EquatableList<T>.

    | Improve this Doc View Source

    Remove(T)

    Removes the first occurrence of a specific object from the EquatableList<T>.

    Declaration
    public virtual bool Remove(T item)
    Parameters
    Type Name Description
    T item

    The object to remove from the EquatableList<T>.

    Returns
    Type Description
    System.Boolean

    true if item was successfully removed from the EquatableList<T>; otherwise, false. This method also returns false if item is not found in the original EquatableList<T>.

    | Improve this Doc View Source

    RemoveAt(Int32)

    Removes the EquatableList<T> item at the specified index.

    Declaration
    public virtual void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the item to remove.

    | Improve this Doc View Source

    ToString()

    Returns a string representation of this collection (and any nested collections). The string representation consists of a list of the collection's elements in the order they are returned by its enumerator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space).

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    a string representation of this collection

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)