Exemple #1
0
 protected override bool IsSupersetOf(ImmSortedSet <T> other)
 {
     return(Root.IsSupersetOf(other.Root));
 }
Exemple #2
0
 protected override SetRelation RelatesTo(ImmSortedSet <T> other)
 {
     return(Root.Relation(other.Root));
 }
Exemple #3
0
 protected override ImmSortedSet <T> Intersect(ImmSortedSet <T> other)
 {
     return(Root.Intersect(other.Root, Lineage.Mutable(), null).Wrap(Comparer));
 }
Exemple #4
0
 protected override bool IsDisjointWith(ImmSortedSet <T> other)
 {
     return(Root.IsDisjoint(other.Root));
 }
Exemple #5
0
 protected override ImmSortedSet <T> Except(ImmSortedSet <T> other)
 {
     return(Root.Except(other.Root, Lineage.Mutable()).Wrap(Comparer));
 }
Exemple #6
0
 protected override ImmSortedSet <T> Union(ImmSortedSet <T> other)
 {
     return(Root.Union(other.Root, null, Lineage.Mutable()).Wrap(Comparer));
 }
Exemple #7
0
 public ImmSortedSetDebugView(ImmSortedSet <T> set)
 {
     _inner        = set;
     zIterableView = new IterableDebugView <T>(set);
 }
Exemple #8
0
 protected override ImmSortedSet <T> Difference(ImmSortedSet <T> other)
 {
     return(Root.SymDifference(other.Root, Lineage.Mutable()).Wrap(Comparer));
 }
Exemple #9
0
 protected override ISetBuilder <T, ImmSortedSet <T> > BuilderFrom(ImmSortedSet <T> collection)
 {
     return(new Builder(Comparer, collection.Root));
 }
Exemple #10
0
 protected override bool IsCompatibleWith(ImmSortedSet <T> other)
 {
     return(Comparer.Equals(other.Comparer));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
 }