Exemplo n.º 1
0
 protected override bool IsSupersetOf(ImmSet <T> other)
 {
     return(Root.IsSupersetOf(other.Root));
 }
Exemplo n.º 2
0
 protected override ImmSet <T> Union(ImmSet <T> other)
 {
     return(Root.Union(other.Root, Lineage.Mutable()).Wrap(EqualityComparer));
 }
Exemplo n.º 3
0
 protected override ImmSet <T> Intersect(ImmSet <T> other)
 {
     return(Root.Intersect(other.Root, Lineage.Mutable(), null).Wrap(EqualityComparer));
 }
Exemplo n.º 4
0
 protected override SetRelation RelatesTo(ImmSet <T> other)
 {
     return(Root.RelatesTo(other.Root));
 }
Exemplo n.º 5
0
 protected override ImmSet <T> Difference(ImmSet <T> other)
 {
     return(Root.SymDifference(other.Root, Lineage.Mutable()).Wrap(EqualityComparer));
 }
Exemplo n.º 6
0
 protected override bool IsCompatibleWith(ImmSet <T> other)
 {
     return(EqualityComparer.Equals(other.EqualityComparer));
 }
Exemplo n.º 7
0
 protected override bool IsDisjointWith(ImmSet <T> other)
 {
     return(Root.IsDisjoint(other.Root));
 }
Exemplo n.º 8
0
 protected override ISetBuilder <T, ImmSet <T> > BuilderFrom(ImmSet <T> collection)
 {
     return(new Builder(collection.EqualityComparer, collection.Root));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Converts the sequence to an <see cref="ImmSet{T}"/>. Optionally, you may provide an eq comparer.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="items"></param>
 /// <param name="eq"></param>
 /// <returns></returns>
 public static ImmSet <T> ToImmSet <T>(this IEnumerable <T> items, IEqualityComparer <T> eq = null)
 {
     return(ImmSet <T> .Empty(eq).Union(items));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Returns an empty <see cref="ImmSet{T}"/> that uses this eq comparer.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="eq"></param>
 /// <returns></returns>
 public static ImmSet <T> CreateSet <T>(this IEqualityComparer <T> eq)
 {
     return(ImmSet <T> .Empty(eq));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Returns an empty <see cref="ImmSet{T}"/> that uses default equality semantics.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static ImmSet <T> Empty <T>()
 {
     return(ImmSet <T> .Empty());
 }
Exemplo n.º 12
0
 public ImmSetDebugView(ImmSet <T> set)
 {
     IterableView = new IterableDebugView <T>(set);
 }