Class CollectionWithoutDuplicatesIListT<T>
- Namespace
- SunamoCollectionWithoutDuplicates
- Assembly
- SunamoCollectionWithoutDuplicates.dll
A collection that automatically prevents duplicate items and implements IList interface
using default equality comparison for type T.
public class CollectionWithoutDuplicatesIListT<T> : CollectionWithoutDuplicatesBaseIList<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
TThe type of items in the collection.
- Inheritance
-
CollectionWithoutDuplicatesIListT<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Methods
AddWithIndex(T)
Adds an item to the collection and returns its index. If the item already exists, returns the existing index without adding a duplicate.
public override int AddWithIndex(T value)
Parameters
valueTThe item to add.
Returns
- int
The zero-based index of the item in the collection.
ContainsN(T)
Determines whether the collection contains the specified item using default equality comparison.
public override bool? ContainsN(T value)
Parameters
valueTThe item to check.
Returns
- bool?
True if the item exists, false if not, or null if the item is the default value for type
T.
IndexOf(T)
Returns the zero-based index of the specified item in the collection using default equality comparison.
public override int IndexOf(T value)
Parameters
valueTThe item to find.
Returns
- int
The zero-based index of the item, or -1 if the item is not found.
IsComparingByString()
Determines whether this collection compares items by their string representation. Always returns false because this class uses default equality comparison.
protected override bool IsComparingByString()
Returns
- bool
Always returns false.