Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
24 | 2 | 2 | 0.986 | class_member_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 24 | 83 | src/Iesi.Collections/Generic/Set.cs |
2 | 25 | 243 | src/Iesi.Collections/Generic/Set.cs |
| ||||
/// <summary> /// Performs a "union" of two sets, where all the elements /// in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. /// The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set /// added in. Neither of the input sets is modified by the operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static ISet<T> Union(ISet<T> a, ISet<T> b) { if (a == null && b == null) return null; else if (a == null) return (ISet<T> )b.Clone(); else if (b == null) return (ISet<T> )a.Clone(); else return a.Union(b); } /// <summary> /// Performs a "union" of two sets, where all the elements /// in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. /// The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set /// added in. Neither of the input sets is modified by the operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static Set<T> operator | (Set<T> a, Set<T> b) { return (Set<T> )Union(a, b); } |
| ||||
/// <summary> /// Performs an "exclusive-or" of the two sets, keeping only the elements that /// are in one of the sets, but not in both. The original sets are not modified /// during this operation. The result set is a <c>Clone()</c> of one of the sets /// (<c>a</c> if it is not <see langword="null" />) containing /// the elements from the exclusive-or operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static ISet<T> ExclusiveOr(ISet<T> a, ISet<T> b) { if (a == null && b == null) return null; else if (a == null) return (ISet<T> )b.Clone(); else if (b == null) return (ISet<T> )a.Clone(); else return a.ExclusiveOr(b); } /// <summary> /// Performs an "exclusive-or" of the two sets, keeping only the elements that /// are in one of the sets, but not in both. The original sets are not modified /// during this operation. The result set is a <c>Clone()</c> of one of the sets /// (<c>a</c> if it is not <see langword="null" />) containing /// the elements from the exclusive-or operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static Set<T> operator ^ (Set<T> a, Set<T> b) { return (Set<T> )ExclusiveOr(a, b); } |
| |||
/// <summary> /// Performs a "union" of two sets, where all the elements /// in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. /// The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set /// added in. Neither of the input sets is modified by the operation. /// Performs an "exclusive-or" of the two sets, keeping only the elements that /// are in one of the sets, but not in both. The original sets are not modified /// during this operation. The result set is a <c>Clone()</c> of one of the sets /// (<c>a</c> if it is not <see langword="null" />) containing /// the elements from the exclusive-or operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> /// <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static ISet<T> [[#variable56a73760]](ISet<T> a, ISet<T> b) { if (a == null && b == null) return null; else if (a == null) return (ISet<T> )b.Clone(); else if (b == null) return (ISet<T> )a.Clone(); else return a. [[#variable56a73760]](b); } /// <summary> /// Performs a "union" of two sets, where all the elements /// in both are present. That is, the element is included if it is in either <c>a</c> or <c>b</c>. /// The return value is a <c>Clone()</c> of one of the sets (<c>a</c> if it is not <see langword="null" />) with elements of the other set /// added in. Neither of the input sets is modified by the operation. /// Performs an "exclusive-or" of the two sets, keeping only the elements that /// are in one of the sets, but not in both. The original sets are not modified /// during this operation. The result set is a <c>Clone()</c> of one of the sets /// (<c>a</c> if it is not <see langword="null" />) containing /// the elements from the exclusive-or operation. /// </summary> /// <param name="a">A set of elements.</param> /// <param name="b">A set of elements.</param> /// <returns>A set containing the union of the input sets. <see langword="null" /> if both sets are <see langword="null" />.</returns> /// <returns>A set containing the result of <c>a ^ b</c>. <see langword="null" /> if both sets are <see langword="null" />.</returns> public static Set<T> operator [[#variable657b4300]](Set<T> a, Set<T> b) { return (Set<T> ) [[#variable56a73760]](a, b); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#56a73760]] | Union |
1 | 2 | [[#56a73760]] | ExclusiveOr |
2 | 1 | [[#657b4300]] | | |
2 | 2 | [[#657b4300]] | ^ |