Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
24 | 3 | 2 | 0.982 | class_member_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 24 | 37 | src/Iesi.Collections/Generic/SynchronizedSet.cs |
2 | 23 | 80 | src/Iesi.Collections/Generic/SynchronizedSet.cs |
3 | 23 | 126 | src/Iesi.Collections/Generic/SynchronizedSet.cs |
| ||||
/// <summary> /// Adds the specified element to this set if it is not already present. /// </summary> /// <param name="o">The object to add to the set.</param> /// <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> public override sealed bool Add(T o) { lock (mSyncRoot) { return mBasisSet.Add(o); } } /// <summary> /// Adds all the elements in the specified collection to the set if they are not already present. /// </summary> /// <param name="c">A collection of objects to add to the set.</param> /// <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> public override sealed bool AddAll(ICollection<T> c) { Set<T> temp; lock (((ICollection) c).SyncRoot) { temp = new HashedSet<T> (c); } lock (mSyncRoot) { return mBasisSet.AddAll(temp); } } |
| ||||
/// <summary> /// Returns <see langword="true" /> if this set contains the specified element. /// </summary> /// <param name="o">The element to look for.</param> /// <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> public override sealed bool Contains(T o) { lock (mSyncRoot) { return mBasisSet.Contains(o); } } /// <summary> /// Returns <see langword="true" /> if the set contains all the elements in the specified collection. /// </summary> /// <param name="c">A collection of objects.</param> /// <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> public override sealed bool ContainsAll(ICollection<T> c) { Set<T> temp; lock (((ICollection) c).SyncRoot) { temp = new HashedSet<T> (c); } lock (mSyncRoot) { return mBasisSet.ContainsAll(temp); } } |
| ||||
/// <summary> /// Removes the specified element from the set. /// </summary> /// <param name="o">The element to be removed.</param> /// <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> public override sealed bool Remove(T o) { lock (mSyncRoot) { return mBasisSet.Remove(o); } } /// <summary> /// Remove all the specified elements from this set, if they exist in this set. /// </summary> /// <param name="c">A collection of elements to remove.</param> /// <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> public override sealed bool RemoveAll(ICollection<T> c) { Set<T> temp; lock (((ICollection) c).SyncRoot) { temp = new HashedSet<T> (c); } lock (mSyncRoot) { return mBasisSet.RemoveAll(temp); } } |
| |||
/// <summary> /// Adds the specified element to this set if it is not already present. /// Returns <see langword="true" /> if this set contains the specified element. /// Removes the specified element from the set. /// </summary> /// <param name="o">The object to add to the set.</param> /// <returns><see langword="true" /> is the object was added, <see langword="false" /> if it was already present.</returns> /// <param name="o">The element to look for.</param> /// <returns><see langword="true" /> if this set contains the specified element, <see langword="false" /> otherwise.</returns> /// <param name="o">The element to be removed.</param> /// <returns><see langword="true" /> if the set contained the specified element, <see langword="false" /> otherwise.</returns> public override sealed bool [[#variable6e09ae80]](T o) { lock (mSyncRoot) { return mBasisSet. [[#variable6e09ae80]](o); } } /// <summary> /// Adds all the elements in the specified collection to the set if they are not already present. /// Returns <see langword="true" /> if the set contains all the elements in the specified collection. /// Remove all the specified elements from this set, if they exist in this set. /// </summary> /// <param name="c">A collection of objects to add to the set.</param> /// <returns><see langword="true" /> is the set changed as a result of this operation, <see langword="false" /> if not.</returns> /// <param name="c">A collection of objects.</param> /// <returns><see langword="true" /> if the set contains all the elements in the specified collection, <see langword="false" /> otherwise.</returns> /// <param name="c">A collection of elements to remove.</param> /// <returns><see langword="true" /> if the set was modified as a result of this operation.</returns> public override sealed bool [[#variable6e09ae40]](ICollection<T> c) { Set<T> temp; lock (((ICollection)c).SyncRoot) { temp = new HashedSet<T> (c); } lock (mSyncRoot) { return mBasisSet. [[#variable6e09ae40]](temp); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6e09ae80]] | Add |
1 | 2 | [[#6e09ae80]] | Contains |
1 | 3 | [[#6e09ae80]] | Remove |
2 | 1 | [[#6e09ae40]] | AddAll |
2 | 2 | [[#6e09ae40]] | ContainsAll |
2 | 3 | [[#6e09ae40]] | RemoveAll |