OrderedBagTView Class |
Namespace: X3Platform.Collections
The OrderedBagTView generic type exposes the following members.
Name | Description | |
---|---|---|
![]() | Add |
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.
(Overrides CollectionBaseTAdd(T).) |
![]() | AsList |
Get a read-only list view of the items in this view. The
items in the list are in sorted order, with the smallest item
at index 0. This view does not copy any data, and reflects any
changes to the underlying OrderedSet.
|
![]() | AsReadOnly |
Provides a read-only view of this collection. The returned ICollection<T> provides
a view of the collection that prevents modifications to the collection. Use the method to provide
access to the collection without allowing changes. Since the returned object is just a view,
changes to the collection will be reflected in the view.
(Inherited from CollectionBaseT.) |
![]() ![]() | Clear |
Removes all the items within this view from the underlying bag.
(Overrides CollectionBaseTClear.) |
![]() | Contains |
Determines if this view of the bag contains an item equal to item. The bag
is not changed. If
(Overrides CollectionBaseTContains(T).) |
![]() | ConvertAllTOutput |
Convert this collection of items by applying a delegate to each item in the collection. The resulting enumeration
contains the result of applying converter to each item in this collection, in
order.
(Inherited from CollectionBaseT.) |
![]() | CopyTo |
Copies all the items in the collection into an array. Implemented by
using the enumerator returned from GetEnumerator to get all the items
and copy them to the provided array.
(Inherited from CollectionBaseT.) |
![]() | CountWhere |
Counts the number of items in the collection that satisfy the condition
defined by predicate.
(Inherited from CollectionBaseT.) |
![]() | Equals | (Inherited from Object.) |
![]() | Exists |
Determines if the collection contains any item that satisfies the condition
defined by predicate.
(Inherited from CollectionBaseT.) |
![]() | Finalize | (Inherited from Object.) |
![]() | FindAll |
Enumerates the items in the collection that satisfy the condition defined
by predicate.
(Inherited from CollectionBaseT.) |
![]() | ForEach |
Performs the specified action on each item in this collection.
(Inherited from CollectionBaseT.) |
![]() | GetEnumerator |
Enumerate all the items in this view.
(Overrides CollectionBaseTGetEnumerator.) |
![]() | GetFirst |
Returns the first item in this view: the item
that would appear first if the view was enumerated.
|
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetLast |
Returns the last item in the view: the item
that would appear last if the view was enumerated.
|
![]() | GetType | (Inherited from Object.) |
![]() | IndexOf |
Get the first index of the given item in the view. The smallest item in the view has index 0,
the next smallest item has index 1, and the largest item has index Count-1.
|
![]() | LastIndexOf |
Get the last index of the given item in the view. The smallest item in the view has index 0,
the next smallest item has index 1, and the largest item has index Count-1.
|
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | Remove |
Searches the underlying bag for an item equal to item, and if found,
removes it from the bag. If not found, the bag is unchanged. If the item is outside
the range of this view, the bag is unchanged.
(Overrides CollectionBaseTRemove(T).) |
![]() | RemoveAll |
Removes all the items in the collection that satisfy the condition
defined by predicate.
(Inherited from CollectionBaseT.) |
![]() | Reversed |
Creates a new View that has the same items as this view, in the reversed order.
|
![]() | ToArray |
Creates an array of the correct size, and copies all the items in the
collection into the array, by calling CopyTo.
(Inherited from CollectionBaseT.) |
![]() | ToString |
Shows the string representation of the collection. The string representation contains
a list of the items in the collection. Contained collections (except string) are expanded
recursively.
(Inherited from CollectionBaseT.) |
![]() | TrueForAll |
Determines if all of the items in the collection satisfy the condition
defined by predicate.
(Inherited from CollectionBaseT.) |
Name | Description | |
---|---|---|
![]() | Count |
Number of items in this view.
(Overrides CollectionBaseTCount.) |
![]() | Item |
Get the item by its index in the sorted order. The smallest item in the view has index 0,
the next smallest item has index 1, and the largest item has index Count-1.
|
Views are dynamic. If the underlying bag changes, the view changes in sync. If a change is made to the view, the underlying bag changes accordingly.
Typically, this class is used in conjunction with a foreach statement to enumerate the items in a subset of the OrderedBag. For example:
foreach(T item in bag.Range(from, to)) { // process item }