| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 44 | 3 | 4 | 0.980 | class_member_declarations[6] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 44 | 25 | src/NHibernate/Type/BagType.cs |
| 2 | 44 | 25 | src/NHibernate/Type/ListType.cs |
| 3 | 46 | 25 | src/NHibernate/Type/SetType.cs |
| ||||
/// <summary>
/// Initializes a new instance of a <see cref="BagType"/> class for
/// a specific role.
/// </summary>
/// <param name="role">The role the persistent collection is in.</param>
/// <param name="propertyRef">The name of the property in the
/// owner object containing the collection ID, or <see langword="null" /> if it is
/// the primary key.</param>
/// <param name="isEmbeddedInXML"></param>
public BagType(string role, string propertyRef, bool isEmbeddedInXML)
: base(role, propertyRef, isEmbeddedInXML)
{
}
/// <summary>
/// Instantiates a new <see cref="IPersistentCollection"/> for the bag.
/// </summary>
/// <param name="session">The current <see cref="ISessionImplementor"/> for the bag.</param>
/// <param name="persister"></param>
/// <param name="key"></param>
/// <returns>A new <see cref="NHibernate.Collection.PersistentBag"/>.</returns>
public override IPersistentCollection Instantiate(ISessionImplementor session, ICollectionPersister persister, object key)
{
return new PersistentBag(session);
}
/// <summary></summary>
public override System.Type ReturnedClass
{
get { return typeof(ICollection);
}
}
/// <summary>
/// Wraps an <see cref="IList"/> in a NHibernate <see cref="PersistentBag"/>.
/// </summary>
/// <param name="session">The <see cref="ISessionImplementor"/> for the collection to be a part of.</param>
/// <param name="collection">The unwrapped <see cref="IList"/>.</param>
/// <returns>
/// An <see cref="PersistentBag"/> that wraps the non NHibernate <see cref="IList"/>.
/// </returns>
public override IPersistentCollection Wrap(ISessionImplementor session, object collection)
{
return new PersistentBag(session, (ICollection) collection);
}
protected override void Add(object collection, object element)
{
((IList) collection).Add(element);
}
protected override void Clear(object collection)
{
((IList) collection).Clear();
}
|
| ||||
/// <summary>
/// Initializes a new instance of a <see cref="ListType"/> class for
/// a specific role.
/// </summary>
/// <param name="role">The role the persistent collection is in.</param>
/// <param name="propertyRef">The name of the property in the
/// owner object containing the collection ID, or <see langword="null" /> if it is
/// the primary key.</param>
/// <param name="isEmbeddedInXML"></param>
public ListType(string role, string propertyRef, bool isEmbeddedInXML)
: base(role, propertyRef, isEmbeddedInXML)
{
}
/// <summary>
/// Instantiates a new <see cref="IPersistentCollection"/> for the bag.
/// </summary>
/// <param name="session">The current <see cref="ISessionImplementor"/> for the bag.</param>
/// <param name="persister"></param>
/// <param name="key"></param>
/// <returns>A new <see cref="NHibernate.Collection.PersistentList"/>.</returns>
public override IPersistentCollection Instantiate(ISessionImplementor session, ICollectionPersister persister, object key)
{
return new PersistentList(session);
}
/// <summary></summary>
public override System.Type ReturnedClass
{
get { return typeof(IList);
}
}
/// <summary>
/// Wraps an exist <see cref="IList"/> in a NHibernate <see cref="PersistentList"/>.
/// </summary>
/// <param name="session">The <see cref="ISessionImplementor"/> for the collection to be a part of.</param>
/// <param name="collection">The unwrapped <see cref="IList"/>.</param>
/// <returns>
/// An <see cref="PersistentList"/> that wraps the non NHibernate <see cref="IList"/>.
/// </returns>
public override IPersistentCollection Wrap(ISessionImplementor session, object collection)
{
return new PersistentList(session, (IList) collection);
}
protected override void Add(object collection, object element)
{
((IList) collection).Add(element);
}
protected override void Clear(object collection)
{
((IList) collection).Clear();
}
|
| ||||
/// <summary>
/// Initializes a new instance of a <see cref="SetType"/> class for
/// a specific role.
/// </summary>
/// <param name="role">The role the persistent collection is in.</param>
/// <param name="propertyRef">The name of the property in the
/// owner object containing the collection ID, or <see langword="null" /> if it is
/// the primary key.</param>
/// <param name="isEmbeddedInXML"></param>
public SetType(string role, string propertyRef, bool isEmbeddedInXML)
: base(role, propertyRef, isEmbeddedInXML)
{
}
/// <summary>
/// Instantiates a new <see cref="IPersistentCollection"/> for the set.
/// </summary>
/// <param name="session">The current <see cref="ISessionImplementor"/> for the set.</param>
/// <param name="persister"></param>
/// <param name="key"></param>
/// <returns></returns>
public override IPersistentCollection Instantiate(ISessionImplementor session, ICollectionPersister persister, object key)
{
return new PersistentSet(session);
}
/// <summary>
/// <see cref="AbstractType.ReturnedClass"/>
/// </summary>
public override System.Type ReturnedClass
{
get { return typeof(ISet);
}
}
/// <summary>
/// Wraps an <see cref="Iesi.Collections.ISet"/> in a <see cref="PersistentSet"/>.
/// </summary>
/// <param name="session">The <see cref="ISessionImplementor"/> for the collection to be a part of.</param>
/// <param name="collection">The unwrapped <see cref="Iesi.Collections.ISet"/>.</param>
/// <returns>
/// An <see cref="PersistentSet"/> that wraps the non NHibernate <see cref="Iesi.Collections.ISet"/>.
/// </returns>
public override IPersistentCollection Wrap(ISessionImplementor session, object collection)
{
return new PersistentSet(session, (ISet) collection);
}
protected override void Add(object collection, object element)
{
((ISet) collection).Add(element);
}
protected override void Clear(object collection)
{
((ISet) collection).Clear();
}
|
| |||
/// <summary>
/// Initializes a new instance of a <see cref="BagType"/> class for
/// Initializes a new instance of a <see cref="SetType"/> class for
/// Initializes a new instance of a <see cref="ListType"/> class for
/// a specific role.
/// </summary>
/// <param name="role">The role the persistent collection is in.</param>
/// <param name="propertyRef">The name of the property in the
/// owner object containing the collection ID, or <see langword="null" /> if it is
/// the primary key.</param>
/// <param name="isEmbeddedInXML"></param>
public [[#variable4f1ff540]](string role, string propertyRef, bool isEmbeddedInXML): base(role, propertyRef, isEmbeddedInXML)
{
}
/// <summary>
/// Instantiates a new <see cref="IPersistentCollection"/> for the bag.
/// Instantiates a new <see cref="IPersistentCollection"/> for the set.
/// </summary>
/// <param name="session">The current <see cref="ISessionImplementor"/> for the bag.</param>
/// <param name="session">The current <see cref="ISessionImplementor"/> for the set.</param>
/// <param name="persister"></param>
/// <param name="key"></param>
/// <returns>A new <see cref="NHibernate.Collection.PersistentBag"/>.</returns>
/// <returns></returns>
/// <returns>A new <see cref="NHibernate.Collection.PersistentList"/>.</returns>
public override IPersistentCollection Instantiate(ISessionImplementor session, ICollectionPersister persister, object key)
{
return new [[#variable6feefb80]](session);
}
/// <summary></summary>
/// <summary>
/// <see cref="AbstractType.ReturnedClass"/>
/// </summary>
public override System.Type ReturnedClass
{
get
{
return typeof( [[#variable6feefba0]]);
}
}
/// <summary>
/// Wraps an <see cref="IList"/> in a NHibernate <see cref="PersistentBag"/>.
/// Wraps an <see cref="Iesi.Collections.ISet"/> in a <see cref="PersistentSet"/>.
/// Wraps an exist <see cref="IList"/> in a NHibernate <see cref="PersistentList"/>.
/// </summary>
/// <param name="session">The <see cref="ISessionImplementor"/> for the collection to be a part of.</param>
/// <param name="collection">The unwrapped <see cref="IList"/>.</param>
/// <param name="collection">The unwrapped <see cref="Iesi.Collections.ISet"/>.</param>
/// <returns>
/// An <see cref="PersistentBag"/> that wraps the non NHibernate <see cref="IList"/>.
/// An <see cref="PersistentSet"/> that wraps the non NHibernate <see cref="Iesi.Collections.ISet"/>.
/// An <see cref="PersistentList"/> that wraps the non NHibernate <see cref="IList"/>.
/// </returns>
public override IPersistentCollection Wrap(ISessionImplementor session, object collection)
{
return new [[#variable6feefb80]](session, ( [[#variable6feefba0]])collection);
}
protected override void Add(object collection, object element)
{
(( [[#variable6feefa60]])collection).Add(element);
}
protected override void Clear(object collection)
{
(( [[#variable6feefa60]])collection).Clear();
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#4f1ff540]] | BagType |
| 1 | 2 | [[#4f1ff540]] | SetType |
| 1 | 3 | [[#4f1ff540]] | ListType |
| 2 | 1 | [[#6feefb80]] | PersistentBag |
| 2 | 2 | [[#6feefb80]] | PersistentSet |
| 2 | 3 | [[#6feefb80]] | PersistentList |
| 3 | 1 | [[#6feefba0]] | ICollection |
| 3 | 2 | [[#6feefba0]] | ISet |
| 3 | 3 | [[#6feefba0]] | IList |
| 4 | 1 | [[#6feefa60]] | IList |
| 4 | 2 | [[#6feefa60]] | ISet |
| 4 | 3 | [[#6feefa60]] | IList |