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.984 | class_member_declarations[2] |

Clone Abstraction | Parameter Bindings |

Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|

1 | 24 | 86 | src/Iesi.Collections/Set.cs |

2 | 25 | 246 | src/Iesi.Collections/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 clone 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 Union(ISet a, ISet b) { if (a == null && b == null) return null; else if (a == null) return (ISet) b.Clone(); else if (b == null) return (ISet) 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 clone 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 operator | (Set a, Set b) { return (Set) 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 clone 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 ExclusiveOr(ISet a, ISet b) { if (a == null && b == null) return null; else if (a == null) return (ISet) b.Clone(); else if (b == null) return (ISet) 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 clone 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 operator ^ (Set a, Set b) { return (Set) 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 clone 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 clone 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 [[#variable47098980]](ISet a, ISet b) { if (a == null && b == null) return null; else if (a == null) return (ISet)b.Clone(); else if (b == null) return (ISet)a.Clone(); else return a. [[#variable47098980]](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 clone 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 clone 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 operator [[#variable47098900]](Set a, Set b) { return (Set) [[#variable47098980]](a, b); } |

CloneAbstraction |

Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|

1 | 1 | [[#47098980]] | Union |

1 | 2 | [[#47098980]] | ExclusiveOr |

2 | 1 | [[#47098900]] | | |

2 | 2 | [[#47098900]] | ^ |