Пример #1
0
 public OrderedMultipleDictionary(bool allowDuplicateValues, Comparison <TKey> keyComparison,
                                  Comparison <TValue> valueComparison)
 {
     Debug.Assert(null != keyComparison, "keyComparison must not be null.");
     Debug.Assert(null != valueComparison, "valueComparison must not be null.");
     BinaryTree = new LeftLeaningRedBlackTree <TKey, TValue>(keyComparison, valueComparison);
 }
Пример #2
0
 public MultipleDictionary(bool allowDuplicateValues, IEqualityComparer <TKey> keyEqualityComparer, IEqualityComparer <TValue> valueEqualityComparer)
 {
     Debug.Assert(null != keyEqualityComparer, "keyEqualityComparer must not be null.");
     Debug.Assert(null != valueEqualityComparer, "valueEqualityComparer must not be null.");
     BinaryTree = new LeftLeaningRedBlackTree <TKey, TValue>(
         (left, right) => keyEqualityComparer.GetHashCode(left).CompareTo(keyEqualityComparer.GetHashCode(right)),
         (left, right) => valueEqualityComparer.GetHashCode(left).CompareTo(valueEqualityComparer.GetHashCode(right)));
 }