Table of Contents

Class CollectionWithoutDuplicatesStringComparing<T>

Namespace
SunamoCollectionWithoutDuplicates
Assembly
SunamoCollectionWithoutDuplicates.dll

A collection that automatically prevents duplicate items by comparing their string representations.

public class CollectionWithoutDuplicatesStringComparing<T> : CollectionWithoutDuplicatesBase<T>

Type Parameters

T

The type of items in the collection.

Inheritance
CollectionWithoutDuplicatesStringComparing<T>
Inherited Members
Extension Methods

Constructors

CollectionWithoutDuplicatesStringComparing()

Initializes a new instance of the collection that compares items by their string representation.

public CollectionWithoutDuplicatesStringComparing()

CollectionWithoutDuplicatesStringComparing(IList<T>)

Initializes a new instance of the collection from an existing list.

public CollectionWithoutDuplicatesStringComparing(IList<T> list)

Parameters

list IList<T>

The list to initialize from.

CollectionWithoutDuplicatesStringComparing(int)

Initializes a new instance of the collection with a specified initial capacity.

public CollectionWithoutDuplicatesStringComparing(int initialCapacity)

Parameters

initialCapacity int

The initial capacity of the collection.

Methods

AddWithIndex(T)

Adds an item to the collection and returns its index. If the item already exists (based on string comparison), returns the existing index.

public override int AddWithIndex(T value)

Parameters

value T

The item to add.

Returns

int

The index of the item in the collection.

Contains(T)

Determines whether the collection contains the specified item based on string comparison.

public override bool? Contains(T value)

Parameters

value T

The item to check.

Returns

bool?

True if the item exists, false otherwise.

IndexOf(T)

Returns the index of the specified item based on string comparison.

public override int IndexOf(T value)

Parameters

value T

The item to find.

Returns

int

The zero-based index of the item.

IsComparingByString()

Determines whether the collection compares items by their string representation.

protected override bool IsComparingByString()

Returns

bool

Always returns true for this class.