using System;
using System.Collections.Generic;
namespace Swan.Collections {
  /// 
  /// Represents a collection of components.
  /// Each component in the collection may be given a unique name for later retrieval.
  /// 
  /// The type of components in the collection.
  public interface IComponentCollection : IReadOnlyList {
    /// 
    /// Gets an  interface representing the named components.
    /// 
    /// 
    /// The named components.
    /// 
    IReadOnlyDictionary Named {
      get;
    }
    /// 
    /// Gets an  interface representing all components
    /// associated with safe names.
    /// The safe name of a component is never .
    /// If a component's unique name if , its safe name
    /// will be some non- string somehow identifying it.
    /// Note that safe names are not necessarily unique.
    /// 
    /// 
    /// A list of s, each containing a safe name and a component.
    /// 
    IReadOnlyList<(String SafeName, T Component)> WithSafeNames {
      get;
    }
    /// 
    /// Gets the component with the specified name.
    /// 
    /// 
    /// The component.
    /// 
    /// The name.
    /// The component with the specified .
    ///  is null.
    /// The property is retrieved and  is not found.
    T this[String name] { get; }
    /// 
    /// Adds a component to the collection,
    /// giving it the specified  if it is not .
    /// 
    /// The name given to the module, or .
    /// The component.
    void Add(String name, T component);
  }
}