Search Results for

    Show / Hide Table of Contents

    Class SimpleListExtensions

    SimpleList<T> Based Extension Methods

    Inheritance
    System.Object
    SimpleListExtensions
    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 Source

    AddUncheckedUniqueItem<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>.

    | Improve this Doc View Source

    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>.

    | Improve this Doc View Source

    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>.

    | Improve this Doc View Source

    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>.

    | Improve this Doc View Source

    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>.

    | Improve this Doc View Source

    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>.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 targetItem in targetSimpleList backing array, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    This will work for System.String comparisons.

    | Improve this Doc View Source

    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 targetItem in targetSimpleList backing array, or -1 if not found.

    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.

    | Improve this Doc View Source

    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 targetValue in targetSimpleList backing array, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    | Improve this Doc View Source

    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 targetItem in targetSimpleList backing array, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    Remarks

    This will work for System.String comparisons.

    | Improve this Doc View Source

    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 targetItem in targetSimpleList backing array, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    | Improve this Doc View Source

    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 targetValue in targetSimpleList backing array, or -1 if not found.

    Type Parameters
    Name Description
    T

    The type of the array.

    | Improve this Doc View Source

    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 targetSimpleList.

    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.

    | Improve this Doc View Source

    RemoveFirstReference<T>(ref SimpleList<T>, T)

    Removes the first targetReference from the provided targetSimpleList.

    Only removes direct object references, i.e. equivalent strings at different memory addresses would not be removed.
    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 targetSimpleList.

    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.

    | Improve this Doc View Source

    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 targetSimpleList.

    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.

    | Improve this Doc View Source

    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 targetSimpleList.

    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.

    | Improve this Doc View Source

    RemoveLastReference<T>(ref SimpleList<T>, T)

    Removes the last reference to targetReference from the provided targetSimpleList.

    Only removes direct object references, i.e. equivalent strings at different memory addresses would not be removed.
    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 targetSimpleList.

    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.

    | Improve this Doc View Source

    RemoveReferences<T>(ref SimpleList<T>, T)

    Removes all instances of references to targetReference from the provided targetSimpleList.

    Only removes direct object references, i.e. equivalent strings at different memory addresses would not be removed.
    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 targetSimpleList.

    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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.