| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 28 | 3 | 2 | 0.964 | namespace_member_declarations |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 28 | 5 | src/Iesi.Collections/HashedSet.cs |
| 2 | 33 | 6 | src/Iesi.Collections/HybridSet.cs |
| 3 | 32 | 6 | src/Iesi.Collections/ListSet.cs |
| ||||
namespace Iesi.Collections
{
/// <summary>
/// Implements a <c>Set</c> based on a hash table. This will give the best lookup, add, and remove
/// performance for very large data-sets, but iteration will occur in no particular order.
/// </summary>
[Serializable]
public class HashedSet : DictionarySet
{
/// <summary>
/// Creates a new set instance based on a hash table.
/// </summary>
public HashedSet()
{
InternalDictionary = new Hashtable();
}
/// <summary>
/// Creates a new set instance based on a hash table and
/// initializes it based on a collection of elements.
/// </summary>
/// <param name="initialValues">A collection of elements that defines the initial set contents.</param>
public HashedSet(ICollection initialValues) : this()
{
this.AddAll(initialValues);
}
}
}
|
| ||||
namespace Iesi.Collections
{
/// <summary>
/// Implements a <c>Set</c> that automatically changes from a list to a hash table
/// when the size reaches a certain threshold. This is good if you are unsure about
/// whether you data-set will be tiny or huge. Because this uses a dual implementation,
/// iteration order is not guaranteed!
/// </summary>
[Serializable]
public class HybridSet : DictionarySet
{
/// <summary>
/// Creates a new set instance based on either a list or a hash table, depending on which
/// will be more efficient based on the data-set size.
/// </summary>
public HybridSet()
{
InternalDictionary = new HybridDictionary();
}
/// <summary>
/// Creates a new set instance based on either a list or a hash table, depending on which
/// will be more efficient based on the data-set size, and
/// initializes it based on a collection of elements.
/// </summary>
/// <param name="initialValues">A collection of elements that defines the initial set contents.</param>
public HybridSet(ICollection initialValues) : this()
{
this.AddAll(initialValues);
}
}
}
|
| ||||
namespace Iesi.Collections
{
/// <summary>
/// Implements a <c>Set</c> based on a list. Performance is much better for very small lists
/// than either <c>HashedSet</c> or <c>SortedSet</c>. However, performance degrades rapidly as
/// the data-set gets bigger. Use a <c>HybridSet</c> instead if you are not sure your data-set
/// will always remain very small. Iteration produces elements in the order they were added.
/// However, element order is not guaranteed to be maintained by the various <c>Set</c>
/// mathematical operators.
/// </summary>
[Serializable]
public class ListSet : DictionarySet
{
/// <summary>
/// Creates a new set instance based on a list.
/// </summary>
public ListSet()
{
InternalDictionary = new ListDictionary();
}
/// <summary>
/// Creates a new set instance based on a list and
/// initializes it based on a collection of elements.
/// </summary>
/// <param name="initialValues">A collection of elements that defines the initial set contents.</param>
public ListSet(ICollection initialValues) : this()
{
this.AddAll(initialValues);
}
}
}
|
| |||
namespace Iesi.Collections
{
/// <summary>
/// Implements a <c>Set</c> based on a hash table. This will give the best lookup, add, and remove
/// performance for very large data-sets, but iteration will occur in no particular order.
/// Implements a <c>Set</c> that automatically changes from a list to a hash table
/// when the size reaches a certain threshold. This is good if you are unsure about
/// whether you data-set will be tiny or huge. Because this uses a dual implementation,
/// iteration order is not guaranteed!
/// Implements a <c>Set</c> based on a list. Performance is much better for very small lists
/// than either <c>HashedSet</c> or <c>SortedSet</c>. However, performance degrades rapidly as
/// the data-set gets bigger. Use a <c>HybridSet</c> instead if you are not sure your data-set
/// will always remain very small. Iteration produces elements in the order they were added.
/// However, element order is not guaranteed to be maintained by the various <c>Set</c>
/// mathematical operators.
/// </summary>
[Serializable]
public class [[#variable5e424340]]: DictionarySet
{
/// <summary>
/// Creates a new set instance based on a hash table.
/// Creates a new set instance based on either a list or a hash table, depending on which
/// will be more efficient based on the data-set size.
/// Creates a new set instance based on a list.
/// </summary>
public [[#variable5e424340]]()
{
InternalDictionary = new [[#variable5e4242c0]]();
}
/// <summary>
/// Creates a new set instance based on a hash table and
/// Creates a new set instance based on either a list or a hash table, depending on which
/// will be more efficient based on the data-set size, and
/// Creates a new set instance based on a list and
/// initializes it based on a collection of elements.
/// </summary>
/// <param name="initialValues">A collection of elements that defines the initial set contents.</param>
public [[#variable5e424340]](ICollection initialValues): this()
{
this.AddAll(initialValues);
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#5e424340]] | HashedSet |
| 1 | 2 | [[#5e424340]] | HybridSet |
| 1 | 3 | [[#5e424340]] | ListSet |
| 2 | 1 | [[#5e4242c0]] | Hashtable |
| 2 | 2 | [[#5e4242c0]] | HybridDictionary |
| 2 | 3 | [[#5e4242c0]] | ListDictionary |