OrderedBagTViewAdd Method |
Adds a new item to the bag underlying this View. If the bag 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 override sealed void Add(
T item
)
public:
virtual void Add(
T item
) override sealed
Parameters
- item
- Type: T
The item to add.
Return Value
Type:
True if the bag already contained an item equal to
item (which was replaced), false
otherwise.
Implements
ICollectionTAdd(T)
RemarksEquality between items is determined by the comparison instance or delegate used
to create the bag.
Adding an item takes time O(log N), where N is the number of items in the bag.
See Also