Class SimpleListExtensions
SimpleList<T> Based Extension Methods
Inheritance
Namespace: GDX.Collections.Generic
Syntax
public static class SimpleListExtensions
Remarks
Methods found in this extensions class are less performant then the included methods in SimpleList<T>. They are seperated out to clearly delineate this performance regression.
Methods
| Improve this Doc View SourceAddUncheckedUniqueItem<T>(ref SimpleList<T>, T)
Add an item to the SimpleList<T> without checking the internal size, making sure that the item is not already contained in the SimpleList<T>.
Declaration
public static bool AddUncheckedUniqueItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T> to add to. |
T | targetItem | The target class object to add. |
Returns
Type | Description |
---|---|
System.Boolean | true/false if the operation was able to add the item successfully. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
AddUncheckedUniqueReference<T>(ref SimpleList<T>, T)
Add an object reference to the SimpleList<T> without checking the internal size, making sure that the reference is not already contained in the SimpleList<T>. Does not prevent addition of different objects for which Equals returns true.
Declaration
public static bool AddUncheckedUniqueReference<T>(this ref SimpleList<T> targetSimpleList, T targetReference)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T> to add to. |
T | targetReference | The target class object to add. |
Returns
Type | Description |
---|---|
System.Boolean | true/false if the operation was able to add the reference successfully. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
AddWithExpandCheckUniqueItem<T>(ref SimpleList<T>, T)
Add an item to the SimpleList<T> with checking the internal size (expanding as necessary), making sure that the item is not already contained in the SimpleList<T>.
Declaration
public static bool AddWithExpandCheckUniqueItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T> to add to. |
T | targetItem | The target class object to add. |
Returns
Type | Description |
---|---|
System.Boolean | true/false if the operation was able to add the item successfully. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
AddWithExpandCheckUniqueReference<T>(ref SimpleList<T>, T)
Add an object reference to the SimpleList<T> with checking the internal size (expanding as necessary), making sure that the reference is not already contained in the SimpleList<T>. Does not prevent addition of different objects for which Equals returns true.
Declaration
public static bool AddWithExpandCheckUniqueReference<T>(this ref SimpleList<T> targetSimpleList, T targetReference)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T> to add to. |
T | targetReference | The target class object to add. |
Returns
Type | Description |
---|---|
System.Boolean | true/false if the operation was able to add the reference successfully. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
AddWithExpandCheckUniqueValue<T>(ref SimpleList<T>, T)
Add an item to the SimpleList<T> with checking the internal size (expanding as necessary), making sure that the item is not already contained in the SimpleList<T>.
Declaration
public static bool AddWithExpandCheckUniqueValue<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T> to add to. |
T | targetItem | The target class object to add. |
Returns
Type | Description |
---|---|
System.Boolean | true/false if the operation was able to add the item successfully. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Contains<T>(ref SimpleList<T>, T)
Does targetSimpleList
contain targetItem
?
Declaration
public static bool Contains<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The target class object to look for. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
ContainsItem<T>(ref SimpleList<T>, T)
Does targetSimpleList
contain targetItem
?
Declaration
public static bool ContainsItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The target class object to look for. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
ContainsReference<T>(ref SimpleList<T>, T)
Does targetSimpleList
contain targetItem
?
Declaration
public static bool ContainsReference<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The target class object to look for. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Ignores equality check and end up comparing object pointers.
ContainsValue<T>(ref SimpleList<T>, T)
Does targetSimpleList
contain targetItem
?
Declaration
public static bool ContainsValue<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The target class object to look for. |
Returns
Type | Description |
---|---|
System.Boolean | true/false |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
FirstIndexOf<T>(ref SimpleList<T>, T)
Find the first index of targetItem
in targetSimpleList
.
Declaration
public static int FirstIndexOf<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The object to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
Remarks
This will work for System.String comparisons.
FirstIndexOfItem<T>(ref SimpleList<T>, T)
Find the first index of targetItem
in targetSimpleList
.
Declaration
public static int FirstIndexOfItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The object to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
Remarks
Ignores equality check and end up comparing object pointers. Do NOT use this for System.String types.
FirstIndexOfValue<T>(ref SimpleList<T>, T)
Find the first index of targetValue
in targetSimpleList
.
Declaration
public static int FirstIndexOfValue<T>(this ref SimpleList<T> targetSimpleList, T targetValue)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetValue | The value to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
LastIndexOf<T>(ref SimpleList<T>, T)
Find the last index of targetItem
in targetSimpleList
.
Declaration
public static int LastIndexOf<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The object to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
Remarks
This will work for System.String comparisons.
LastIndexOfItem<T>(ref SimpleList<T>, T)
Find the last index of targetItem
in targetSimpleList
.
Declaration
public static int LastIndexOfItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetItem | The object to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
LastIndexOfValue<T>(ref SimpleList<T>, T)
Find the last index of targetValue
in targetSimpleList
.
Declaration
public static int LastIndexOfValue<T>(this ref SimpleList<T> targetSimpleList, T targetValue)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The SimpleList<T> to look in. |
T | targetValue | The value to be found. |
Returns
Type | Description |
---|---|
System.Int32 | The index of |
Type Parameters
Name | Description |
---|---|
T | The type of the array. |
RemoveFirstItem<T>(ref SimpleList<T>, T)
Removes the first targetItem
from the provided targetSimpleList
.
Declaration
public static bool RemoveFirstItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetItem | The target object to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if an item was removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
RemoveFirstReference<T>(ref SimpleList<T>, T)
Removes the first targetReference
from the provided targetSimpleList
.
Declaration
public static bool RemoveFirstReference<T>(this ref SimpleList<T> targetSimpleList, T targetReference)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetReference | The target object to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if an object reference was removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
RemoveItems<T>(ref SimpleList<T>, T)
Removes all targetItem
from the provided targetSimpleList
.
Declaration
public static bool RemoveItems<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetItem | The item to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if items were removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
RemoveLastItem<T>(ref SimpleList<T>, T)
Removes the last targetItem
from the provided targetSimpleList
.
Declaration
public static bool RemoveLastItem<T>(this ref SimpleList<T> targetSimpleList, T targetItem)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetItem | The target object to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if an item was removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
RemoveLastReference<T>(ref SimpleList<T>, T)
Removes the last reference to targetReference
from the provided
targetSimpleList
.
Declaration
public static bool RemoveLastReference<T>(this ref SimpleList<T> targetSimpleList, T targetReference)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetReference | The target object reference to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if an object reference was removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.
RemoveReferences<T>(ref SimpleList<T>, T)
Removes all instances of references to targetReference
from the provided
targetSimpleList
.
Declaration
public static bool RemoveReferences<T>(this ref SimpleList<T> targetSimpleList, T targetReference)
where T : class
Parameters
Type | Name | Description |
---|---|---|
SimpleList<T> | targetSimpleList | The target SimpleList<T>. |
T | targetReference | The object reference to remove from the |
Returns
Type | Description |
---|---|
System.Boolean | true/false if any references were removed. |
Type Parameters
Name | Description |
---|---|
T | The type of the SimpleList<T>. |
Remarks
Avoids using System.Collections.Generic.EqualityComparer`1.