OrderedSetTViewAdd 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: 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.
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