Beispiel #1
0
 protected override bool IsSupersetOf(ImmSortedSet <T> other)
 {
     return(Root.IsSupersetOf(other.Root));
 }
Beispiel #2
0
 protected override SetRelation RelatesTo(ImmSortedSet <T> other)
 {
     return(Root.Relation(other.Root));
 }
Beispiel #3
0
 protected override ImmSortedSet <T> Intersect(ImmSortedSet <T> other)
 {
     return(Root.Intersect(other.Root, Lineage.Mutable(), null).Wrap(Comparer));
 }
Beispiel #4
0
 protected override bool IsDisjointWith(ImmSortedSet <T> other)
 {
     return(Root.IsDisjoint(other.Root));
 }
Beispiel #5
0
 protected override ImmSortedSet <T> Except(ImmSortedSet <T> other)
 {
     return(Root.Except(other.Root, Lineage.Mutable()).Wrap(Comparer));
 }
Beispiel #6
0
 protected override ImmSortedSet <T> Union(ImmSortedSet <T> other)
 {
     return(Root.Union(other.Root, null, Lineage.Mutable()).Wrap(Comparer));
 }
Beispiel #7
0
 public ImmSortedSetDebugView(ImmSortedSet <T> set)
 {
     _inner        = set;
     zIterableView = new IterableDebugView <T>(set);
 }
Beispiel #8
0
 protected override ImmSortedSet <T> Difference(ImmSortedSet <T> other)
 {
     return(Root.SymDifference(other.Root, Lineage.Mutable()).Wrap(Comparer));
 }
Beispiel #9
0
 protected override ISetBuilder <T, ImmSortedSet <T> > BuilderFrom(ImmSortedSet <T> collection)
 {
     return(new Builder(Comparer, collection.Root));
 }
Beispiel #10
0
 protected override bool IsCompatibleWith(ImmSortedSet <T> other)
 {
     return(Comparer.Equals(other.Comparer));
 }
Beispiel #11
0
 /// <summary>
 /// Returns an empty <see cref="ImmSortedSet{T}"/> using the specified comparer.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="comparer"></param>
 /// <returns></returns>
 public static ImmSortedSet <T> CreateOrderedSet <T>(this IComparer <T> comparer)
 {
     return(ImmSortedSet <T> .Empty(comparer));
 }
Beispiel #12
0
 /// <summary>
 /// Converts a sequence of elements to an <see cref="ImmSortedSet{T}"/> using the specified comparer.
 /// </summary>
 /// <typeparam name="T">The type of element.</typeparam>
 /// <param name="items">The sequence to be converted.</param>
 /// <returns></returns>
 public static ImmSortedSet <T> ToImmSortedSet <T>(this IEnumerable <T> items)
     where T : IComparable <T>
 {
     return(ImmSortedSet <T> .Empty(null).Union(items));
 }
Beispiel #13
0
 /// <summary>
 /// Converts a sequence of elements to an <see cref="ImmSortedSet{T}"/> using the specified comparer.
 /// </summary>
 /// <typeparam name="T">The type of element.</typeparam>
 /// <param name="items">The sequence to be converted.</param>
 /// <param name="cmp">The comparer.</param>
 /// <returns></returns>
 public static ImmSortedSet <T> ToImmSortedSet <T>(this IEnumerable <T> items, IComparer <T> cmp)
 {
     return(ImmSortedSet <T> .Empty(cmp).Union(items));
 }
Beispiel #14
0
 /// <summary>
 /// Returns an empty instance of <see cref="ImmSortedSet{T}"/> using the specified comparer.
 /// </summary>
 /// <typeparam name="T">The type of element.</typeparam>
 /// <param name="cmp">The comparer.</param>
 /// <returns></returns>
 public static ImmSortedSet <T> Empty <T>(IComparer <T> cmp)
 {
     return(ImmSortedSet <T> .Empty(cmp));
 }
Beispiel #15
0
 /// <summary>
 /// Returns an empty <see cref="ImmSortedSet{T}"/> using the default comparison semantics of the type.
 /// </summary>
 /// <typeparam name="T">The type of element.</typeparam>
 /// <returns></returns>
 public static ImmSortedSet <T> Empty <T>()
     where T : IComparable <T>
 {
     return(ImmSortedSet <T> .Empty(null));
 }