Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

View..::..Add Method

Adds a new item to the set underlying this View. If the set already contains an item equal to item, that item is replaces with item. If item is outside the range of this view, an InvalidOperationException is thrown.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public bool Add(
	T item
)
Public Function Add ( _
	item As T _
) As Boolean
public:
bool^ Add(
	T item
)

Parameters

item
Type: T
The item to add.

Return Value

True if the set already contained an item equal to item (which was replaced), false otherwise.

Remarks


Equality between items is determined by the comparison instance or delegate used to create the set.

Adding an item takes time O(log N), where N is the number of items in the set.