BigListT Class |
Namespace: X3Platform.Collections
The BigListT type exposes the following members.
Name | Description | |
---|---|---|
![]() | BigListT |
Creates a new BigList. The BigList is initially empty.
|
![]() | BigListT(IEnumerableT) |
Creates a new BigList initialized with the items from collection, in order.
|
![]() | BigListT(BigListT) |
Creates a new BigList that is a copy of list.
|
![]() | BigListT(IEnumerableT, Int32) |
Creates a new BigList initialized with a given number of copies of the items from collection, in order.
|
![]() | BigListT(BigListT, Int32) |
Creates a new BigList that is several copies of list.
|
Name | Description | |
---|---|---|
![]() | Add |
Adds an item to the end of the BigList. The indices of all existing items
in the Deque are unchanged.
(Overrides ListBaseTAdd(T).) |
![]() | AddRange(IEnumerableT) |
Adds a collection of items to the end of BigList. The indices of all existing items
are unchanged. The last item in the added collection becomes the
last item in the BigList.
|
![]() | AddRange(BigListT) |
Adds a BigList of items to the end of BigList. The indices of all existing items
are unchanged. The last item in list becomes the
last item in this list. The added list list is unchanged.
|
![]() | AddRangeToFront(IEnumerableT) |
Adds a collection of items to the front of BigList. The indices of all existing items
in the are increased by the number of items in collection.
The first item in the added collection becomes the first item in the BigList.
|
![]() | AddRangeToFront(BigListT) |
Adds a BigList of items to the front of BigList. The indices of all existing items
are increased by the number of items in list. The first item in list
becomes the first item in this list. The added list list is unchanged.
|
![]() | AddToFront |
Adds an item to the beginning of the BigList. The indices of all existing items
in the Deque are increased by one, and the new item has index zero.
|
![]() | AsReadOnly |
Provides a read-only view of this list. The returned IList<T> provides
a view of the list that prevents modifications to the list. Use the method to provide
access to the list without allowing changes. Since the returned object is just a view,
changes to the list will be reflected in the view.
(Inherited from ListBaseT.) |
![]() | BinarySearch(T) |
Searches a sorted list for an item via binary search. The list must be sorted
in the order defined by the default ordering of the item type; otherwise,
incorrect results will be returned.
|
![]() | BinarySearch(T, IComparerT) |
Searches a sorted list for an item via binary search. The list must be sorted
by the ordering defined by the passed IComparer<T> interface; otherwise,
incorrect results will be returned.
|
![]() | BinarySearch(T, ComparisonT) |
Searches a sorted list for an item via binary search. The list must be sorted
by the ordering defined by the passed Comparison<T> delegate; otherwise,
incorrect results will be returned.
|
![]() | Clear |
Removes all of the items from the BigList.
(Overrides ListBaseTClear.) |
![]() | Clone |
Creates a new BigList that is a copy of this list.
|
![]() | CloneContents |
Makes a deep clone of this BigList. A new BigList is created with a clone of
each element of this set, by calling ICloneable.Clone on each element. If T is
a value type, then this method is the same as Clone.
|
![]() | Contains |
Determines if the list contains any item that compares equal to item.
The implementation simply checks whether IndexOf(item) returns a non-negative value.
(Inherited from ListBaseT.) |
![]() | ConvertAllTDest(ConverterT, TDest) |
Convert the list to a new list by applying a delegate to each item in the collection. The resulting list
contains the result of applying converter to each item in the list, in
order. The current list is unchanged.
|
![]() | ConvertAllTOutput(ConverterT, TOutput) |
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(T) |
Copies all the items in the list, in order, to array,
starting at index 0.
(Inherited from ListBaseT.) |
![]() | CopyTo(T, Int32) |
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.) |
![]() | CopyTo(Int32, T, Int32, Int32) |
Copies a range of elements from the list to array,
starting at arrayIndex.
(Inherited from ListBaseT.) |
![]() | 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.) |
![]() | Find |
Finds the first item in the list that satisfies the condition
defined by predicate. If no item matches the condition, than
the default value for T (null or all-zero) is returned.
(Inherited from ListBaseT.) |
![]() | FindAll |
Enumerates the items in the collection that satisfy the condition defined
by predicate.
(Inherited from CollectionBaseT.) |
![]() | FindIndex(PredicateT) |
Finds the index of the first item in the list that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | FindIndex(Int32, PredicateT) |
Finds the index of the first item, in the range of items extending from index to the end, that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | FindIndex(Int32, Int32, PredicateT) |
Finds the index of the first item, in the range of count items starting from index, that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | FindLast |
Finds the last item in the list that satisfies the condition
defined by predicate. If no item matches the condition, than
the default value for T (null or all-zero) is returned.
(Inherited from ListBaseT.) |
![]() | FindLastIndex(PredicateT) |
Finds the index of the last item in the list that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | FindLastIndex(Int32, PredicateT) |
Finds the index of the last item, in the range of items extending from the beginning
of the list to index, that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | FindLastIndex(Int32, Int32, PredicateT) |
Finds the index of the last item, in the range of count items ending at index, that satisfies the condition
defined by predicate. If no item matches the condition, -1 is returned.
(Inherited from ListBaseT.) |
![]() | ForEach |
Performs the specified action on each item in this collection.
(Inherited from CollectionBaseT.) |
![]() | GetEnumerator |
Enumerates all of the items in the list, in order. The item at index 0
is enumerated first, then the item at index 1, and so on. Usually, the
foreach statement is used to call this method implicitly.
(Overrides ListBaseTGetEnumerator.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetRange |
Creates a new list that contains a subrange of elements from this list. The
current list is unchanged.
|
![]() | GetType | (Inherited from Object.) |
![]() | IndexOf(T) |
Finds the index of the first item in the list that is equal to item.
(Inherited from ListBaseT.) |
![]() | IndexOf(T, Int32) |
Finds the index of the first item, in the range of items extending from index to the end,
that is equal to item.
(Inherited from ListBaseT.) |
![]() | IndexOf(T, Int32, Int32) |
Finds the index of the first item, in the range of count items starting from index,
that is equal to item.
(Inherited from ListBaseT.) |
![]() | Insert |
Inserts a new item at the given index in the BigList. All items at indexes
equal to or greater than index move up one index.
(Overrides ListBaseTInsert(Int32, T).) |
![]() | InsertRange(Int32, IEnumerableT) |
Inserts a collection of items at the given index in the BigList. All items at indexes
equal to or greater than index increase their indices
by the number of items inserted.
|
![]() | InsertRange(Int32, BigListT) |
Inserts a BigList of items at the given index in the BigList. All items at indexes
equal to or greater than index increase their indices
by the number of items inserted.
|
![]() | LastIndexOf(T) |
Finds the index of the last item in the list that is equal to item.
(Inherited from ListBaseT.) |
![]() | LastIndexOf(T, Int32) |
Finds the index of the last item, in the range of items extending from the beginning
of the list to index, that is equal to item.
(Inherited from ListBaseT.) |
![]() | LastIndexOf(T, Int32, Int32) |
Finds the index of the last item, in the range of count items ending at index,
that is equal to item.
(Inherited from ListBaseT.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | Range |
Returns a view onto a sub-range of this list. Items are not copied; the
returned IList<T> is simply a different view onto the same underlying items. Changes to this list
are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the
view, but insertions and deletions in the underlying list do not.
(Overrides ListBaseTRange(Int32, Int32).) |
![]() | Remove |
Searches the list for the first item that compares equal to item.
If one is found, it is removed. Otherwise, the list is unchanged.
(Inherited from ListBaseT.) |
![]() | RemoveAll |
Removes all the items in the collection that satisfy the condition
defined by predicate.
(Inherited from CollectionBaseT.) |
![]() | RemoveAt |
Removes the item at the given index in the BigList. All items at indexes
greater than index move down one index.
(Overrides ListBaseTRemoveAt(Int32).) |
![]() | RemoveRange |
Removes a range of items at the given index in the Deque. All items at indexes
greater than index move down count indices
in the Deque.
|
![]() | Reverse |
Reverses the current list in place.
|
![]() | Reverse(Int32, Int32) |
Reverses the items in the range of count items starting from start, in place.
|
![]() | Sort |
Sorts the list in place.
|
![]() | Sort(IComparerT) |
Sorts the list in place. A supplied IComparer<T> is used
to compare the items in the list.
|
![]() | Sort(ComparisonT) |
Sorts the list in place. A supplied Comparison<T> delegate is used
to compare the items in the list.
|
![]() | 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.) |
![]() | TryFind |
Finds the first item in the list that satisfies the condition
defined by predicate.
(Inherited from ListBaseT.) |
![]() | TryFindLast |
Finds the last item in the list that satisfies the condition
defined by predicate.
(Inherited from ListBaseT.) |
Name | Description | |
---|---|---|
![]() ![]() | Addition |
Concatenates two lists together to create a new list. Both lists being concatenated
are unchanged. The resulting list contains all the items in first, followed
by all the items in second.
|
Name | Description | |
---|---|---|
![]() | Count |
Gets the number of items stored in the BigList. The indices of the items
range from 0 to Count-1.
(Overrides ListBaseTCount.) |
![]() | Item |
Gets or sets an item in the list, by index.
(Overrides ListBaseTItemInt32.) |
BigList<T> class is similar in functionality to the standard List<T> class. Both classes provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less than the count of items in the collection. Both classes provide the ability to add and remove items from any index, and the get or set the item at any index.
BigList<T> differs significantly from List<T> in the performance of various operations, especially when the lists become large (several hundred items or more). With List<T>, inserting or removing elements from anywhere in a large list except the end is very inefficient -- every item after the point of inserting or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional memory allocated to store the distinct parts of the lists.
Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot more efficient than using a for loop and indexing the list.
In general, use a List when the only operations you are using are Add (to the end), foreach, or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. In almost all cases, BigList is more efficient and easier to use than LinkedList.