コード例 #1
0
        /// <summary>
        /// Creates a new instance of <see cref="RedBlackCollection{T}"/>.
        /// </summary>
        /// <param name="space">The number of total new elements to insert for each single new element inserted.</param>
        /// <param name="comparer">The comparer class.</param>
        /// <param name="sortOrder">The sort order.</param>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        /// <exception cref="ArgumentException"></exception>
        public RedBlackCollection(IComparer <T> comparer, float threshold = 1.2f, RebalanceStrategy globStrategy = RebalanceStrategy.Cadance4, RebalanceStrategy locStrategy = RebalanceStrategy.Cadence16) : base(comparer)
        {
            rebalanceThreshold = threshold;
            globalStrategy     = globStrategy;
            localStrategy      = locStrategy;

            items = new List <T>();

            arrspace = new T[2];
        }
コード例 #2
0
 /// <summary>
 /// Creates a new instance of <see cref="RedBlackCollection{T}"/>.
 /// </summary>
 /// <param name="initialItems">The initial items used to populate the collection.</param>
 /// <param name="sortOrder">The sort order.</param>
 /// <exception cref="ArgumentOutOfRangeException"></exception>
 /// <exception cref="ArgumentException"></exception>
 public RedBlackCollection(IEnumerable <T> initialItems, float threshold = 1.2f, RebalanceStrategy globStrategy = RebalanceStrategy.Cadance4, RebalanceStrategy locStrategy = RebalanceStrategy.Cadence16) : this((IComparer <T>)null, threshold, globStrategy, locStrategy)
 {
     AddRange(initialItems);
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of <see cref="RedBlackCollection{T}"/>.
 /// </summary>
 /// <param name="sortOrder">The sort order.</param>
 /// <exception cref="ArgumentOutOfRangeException"></exception>
 /// <exception cref="ArgumentException"></exception>
 public RedBlackCollection(float threshold = 1.2f, RebalanceStrategy globStrategy = RebalanceStrategy.Cadance4, RebalanceStrategy locStrategy = RebalanceStrategy.Cadence16) : this((IComparer <T>)null, threshold, globStrategy, locStrategy)
 {
 }