Adds a new item to the set. If the set already contains an item equal to
item, that item is replaced with item.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic bool Add(
T item
)
public:
bool Add(
T item
)
Parameters
- item
- Type: T
The item to add to the set.
Return Value
Type:
BooleanTrue if the set already contained an item equal to
item (which was replaced), false
otherwise.
RemarksEquality 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.
See Also