An unordered collection of items.
More...
|
| Bag () |
| Construct a new bag. More...
|
|
| Bag (int capacity) |
| Construct a new bag with the given initial capacity. More...
|
|
| Bag (IEnumerable< T > collection) |
| Construct a new bag containing all of the elements inside of the given collection. More...
|
|
| Bag (IList< T > list) |
| Construct a new bag containing all of the elements inside of the given list. More...
|
|
void | CopyFrom (Bag< T > bag) |
| Copies from the given bag into this one. More...
|
|
Bag< T > | Copy () |
| Creates a duplicate of this bag that has a different backing array. More...
|
|
int | IndexOf (T item) |
| Returns the index of the given item in the bag, or -1 if it is not found. More...
|
|
void | Remove (int index) |
| Removes the item at given index from the bag in O(1) time. This operation does not maintain the order of elements inside of the bag! More...
|
|
void | Clear () |
| Clears all stored items from this instance. More...
|
|
bool | Remove (T item) |
| Remove the item from the bag. This is O(n) and has to scan the bag to find the item. More...
|
|
void | Add (T value) |
|
bool | Contains (T item) |
| Returns true if the Bag contains an instance of the given item. More...
|
|
|
T | this[int index] [get, set] |
|
int | Length [get, set] |
|
An unordered collection of items.
Forge.Collections.Bag< T >.Bag |
( |
| ) |
|
Forge.Collections.Bag< T >.Bag |
( |
int |
capacity | ) |
|
Construct a new bag with the given initial capacity.
- Parameters
-
capacity | How many items the bag can store without reallocating internal data structures. |
Forge.Collections.Bag< T >.Bag |
( |
IEnumerable< T > |
collection | ) |
|
Construct a new bag containing all of the elements inside of the given collection.
Forge.Collections.Bag< T >.Bag |
( |
IList< T > |
list | ) |
|
Construct a new bag containing all of the elements inside of the given list.
void Forge.Collections.Bag< T >.Clear |
( |
| ) |
|
Clears all stored items from this instance.
bool Forge.Collections.Bag< T >.Contains |
( |
T |
item | ) |
|
Returns true if the Bag contains an instance of the given item.
- Parameters
-
item | The item to search for. |
- Returns
- True if it is in the bag, false otherwise.
Bag<T> Forge.Collections.Bag< T >.Copy |
( |
| ) |
|
Creates a duplicate of this bag that has a different backing array.
void Forge.Collections.Bag< T >.CopyFrom |
( |
Bag< T > |
bag | ) |
|
Copies from the given bag into this one.
- Parameters
-
int Forge.Collections.Bag< T >.IndexOf |
( |
T |
item | ) |
|
Returns the index of the given item in the bag, or -1 if it is not found.
void Forge.Collections.Bag< T >.Remove |
( |
int |
index | ) |
|
Removes the item at given index from the bag in O(1) time. This operation does not maintain the order of elements inside of the bag!
bool Forge.Collections.Bag< T >.Remove |
( |
T |
item | ) |
|
Remove the item from the bag. This is O(n) and has to scan the bag to find the item.
- Returns
- True if the item was found and removed, false otherwise.
The documentation for this class was generated from the following file: