protected override bool IsSupersetOf(ImmSet <T> other) { return(Root.IsSupersetOf(other.Root)); }
protected override ImmSet <T> Union(ImmSet <T> other) { return(Root.Union(other.Root, Lineage.Mutable()).Wrap(EqualityComparer)); }
protected override ImmSet <T> Intersect(ImmSet <T> other) { return(Root.Intersect(other.Root, Lineage.Mutable(), null).Wrap(EqualityComparer)); }
protected override SetRelation RelatesTo(ImmSet <T> other) { return(Root.RelatesTo(other.Root)); }
protected override ImmSet <T> Difference(ImmSet <T> other) { return(Root.SymDifference(other.Root, Lineage.Mutable()).Wrap(EqualityComparer)); }
protected override bool IsCompatibleWith(ImmSet <T> other) { return(EqualityComparer.Equals(other.EqualityComparer)); }
protected override bool IsDisjointWith(ImmSet <T> other) { return(Root.IsDisjoint(other.Root)); }
protected override ISetBuilder <T, ImmSet <T> > BuilderFrom(ImmSet <T> collection) { return(new Builder(collection.EqualityComparer, collection.Root)); }
/// <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)); }
/// <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)); }
/// <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()); }
public ImmSetDebugView(ImmSet <T> set) { IterableView = new IterableDebugView <T>(set); }