Search Results for

    Show / Hide Table of Contents

    Class UniqueNameMap<T>

    Generates a unique name for every value that is given to it. Generated names are stored. Requesting a name for the same object more than once always results in the same unique name.

    Inheritance
    object
    UniqueNameMap<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Collections
    Assembly: Flame.dll
    Syntax
    public sealed class UniqueNameMap<T>
    Type Parameters
    Name Description
    T

    The type of value to generate names for.

    Constructors

    | Edit this page View Source

    UniqueNameMap(UniqueNameSet<T>)

    Creates a unique name map from a unique name set.

    Declaration
    public UniqueNameMap(UniqueNameSet<T> nameSet)
    Parameters
    Type Name Description
    UniqueNameSet<T> nameSet

    A pre-existing unique name set to use.

    | Edit this page View Source

    UniqueNameMap(Func<T, string>, Func<T, int, string>)

    Creates a unique name map from a particular name-providing function and a name-generating function that is used to resolve collisions.

    Declaration
    public UniqueNameMap(Func<T, string> getName, Func<T, int, string> generateName)
    Parameters
    Type Name Description
    Func<T, string> getName

    A function that maps values to their preferred names.

    Func<T, int, string> generateName

    A function that takes a value and an integer and combines them into a name. This function is called with increasingly large integers when a collision occurs, until a unique name is found.

    | Edit this page View Source

    UniqueNameMap(Func<T, string>, string)

    Creates a unique name map from a particular name-providing function and a prefix that is used to resolve collisions.

    Declaration
    public UniqueNameMap(Func<T, string> getName, string prefix)
    Parameters
    Type Name Description
    Func<T, string> getName

    A function that maps values to their preferred names.

    string prefix

    A string prefix that is used to generate a unique name when a collision occurs.

    Properties

    | Edit this page View Source

    this[T]

    Gets the name that the given element is mapped to.

    Declaration
    public string this[T element] { get; }
    Parameters
    Type Name Description
    T element
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    Get(T)

    Gets the name that the given element is mapped to.

    Declaration
    public string Get(T element)
    Parameters
    Type Name Description
    T element
    Returns
    Type Description
    string
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX