예제 #1
0
 public ImmSortedMapDebugView(ImmSortedMap <TKey, TValue> map)
 {
     _inner        = map;
     zIterableView = new IterableDebugView <KeyValuePair <TKey, TValue> > (map);
 }
예제 #2
0
 protected override IMapBuilder <TKey, TValue, ImmSortedMap <TKey, TValue> > BuilderFrom(ImmSortedMap <TKey, TValue> collection)
 {
     return(new Builder(collection));
 }
예제 #3
0
 protected override ImmSortedMap <TKey, TValue> Difference(ImmSortedMap <TKey, TValue> other)
 {
     return(Root.SymDifference(other.Root, Lineage.Mutable()).WrapMap(Comparer));
 }
예제 #4
0
 protected override ImmSortedMap <TKey, TValue> Subtract(ImmSortedMap <TKey, TValue> other, ValueSelector <TKey, TValue, TValue, Optional <TValue> > subtraction = null)
 {
     return(Root.Except(other.Root, Lineage.Mutable(), subtraction).WrapMap(Comparer));
 }
예제 #5
0
 protected override ImmSortedMap <TKey, TValue> Merge(ImmSortedMap <TKey, TValue> other,
                                                      ValueSelector <TKey, TValue, TValue, TValue> collision = null)
 {
     return(Root.Union(other.Root, collision, Lineage.Mutable()).WrapMap(Comparer));
 }
예제 #6
0
 protected override ImmSortedMap <TKey, TValue> Join(ImmSortedMap <TKey, TValue> other,
                                                     ValueSelector <TKey, TValue, TValue, TValue> collision = null)
 {
     return(Root.Intersect(other.Root, Lineage.Mutable(), collision).WrapMap(Comparer));
 }
예제 #7
0
 protected override bool IsCompatibleWith(ImmSortedMap <TKey, TValue> other)
 {
     return(Comparer.Equals(other.Comparer));
 }
예제 #8
0
 public Builder(ImmSortedMap <TKey, TValue> inner)
     : this(inner.Root, inner.Comparer)
 {
 }
예제 #9
0
 /// <summary>
 /// Returns an empty ordered map for the specified types using the specified comparison handler.
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="cmp"></param>
 /// <returns></returns>
 public static ImmSortedMap <TKey, TValue> Empty <TKey, TValue>(IComparer <TKey> cmp)
 {
     return(ImmSortedMap <TKey, TValue> .Empty(cmp));
 }
예제 #10
0
 /// <summary>
 /// Returns an empty ordered map for the specified types using default comparison semantics.
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <returns></returns>
 public static ImmSortedMap <TKey, TValue> Empty <TKey, TValue>()
     where TKey : IComparable <TKey>
 {
     return(ImmSortedMap <TKey, TValue> .Empty(null));
 }
예제 #11
0
 /// <summary>
 /// Returns a new empty ordered map using the specified comparer.
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="comparer"></param>
 /// <returns></returns>
 public static ImmSortedMap <TKey, TValue> CreateOrderedMap <TKey, TValue>(this IComparer <TKey> comparer)
 {
     return(ImmSortedMap <TKey, TValue> .Empty(comparer));
 }
예제 #12
0
 /// <summary>
 /// Converts a sequence of key-value pairs to an ordered map, with the specified comparison semantics.
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="kvps"></param>
 /// <param name="cmp"></param>
 /// <returns></returns>
 public static ImmSortedMap <TKey, TValue> ToImmSortedMap <TKey, TValue>(
     this IEnumerable <KeyValuePair <TKey, TValue> > kvps, IComparer <TKey> cmp)
 {
     return(ImmSortedMap <TKey, TValue> .Empty(cmp).AddRange(kvps));
 }
예제 #13
0
 /// <summary>
 /// Converts a sequence of key-value pairs to an ordered map. The keys must be IComparable.
 /// </summary>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="kvps"></param>
 /// <returns></returns>
 public static ImmSortedMap <TKey, TValue> ToImmSortedMap <TKey, TValue>(
     this IEnumerable <KeyValuePair <TKey, TValue> > kvps)
     where TKey : IComparable <TKey>
 {
     return(ImmSortedMap <TKey, TValue> .Empty(null).AddRange(kvps));
 }