Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
90 | 2 | 5 | 0.964 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 90 | 385 | src/NHibernate/Util/LinkedHashMap.cs |
2 | 90 | 474 | src/NHibernate/Util/LinkedHashMap.cs |
| ||||
#endregion private class KeyCollection : ICollection<TKey> { private readonly LinkedHashMap<TKey, TValue> dictionary; public KeyCollection(LinkedHashMap<TKey, TValue> dictionary) { this.dictionary = dictionary; } #region ICollection<TKey> Members void ICollection<TKey>.Add(TKey item) { throw new NotSupportedException("LinkedHashMap KeyCollection is readonly."); } void ICollection<TKey>.Clear() { throw new NotSupportedException("LinkedHashMap KeyCollection is readonly."); } bool ICollection<TKey>.Contains(TKey item) { foreach (TKey key in this ) { if (key.Equals(item)) return true; } return false; } public void CopyTo(TKey[] array, int arrayIndex) { foreach (TKey key in this ) array.SetValue(key, arrayIndex++); } bool ICollection<TKey>.Remove(TKey item) { throw new NotSupportedException("LinkedHashMap KeyCollection is readonly."); } public int Count { get { return dictionary.Count; } } bool ICollection<TKey>.IsReadOnly { get { return true; } } #endregion #region IEnumerable<TKey> Members IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator() { return new Enumerator(dictionary); } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<TKey> )this ).GetEnumerator(); } #endregion private class Enumerator : ForwardEnumerator<TKey> { public Enumerator(LinkedHashMap<TKey, TValue> dictionary) : base(dictionary) { } public override TKey Current { get { if (dictionary.version != version) throw new InvalidOperationException("Enumerator was modified"); return current.Key; } } } } |
| ||||
private class ValuesCollection : ICollection<TValue> { private readonly LinkedHashMap<TKey, TValue> dictionary; public ValuesCollection(LinkedHashMap<TKey, TValue> dictionary) { this.dictionary = dictionary; } #region ICollection<TValue> Members void ICollection<TValue>.Add(TValue item) { throw new NotSupportedException("LinkedHashMap ValuesCollection is readonly."); } void ICollection<TValue>.Clear() { throw new NotSupportedException("LinkedHashMap ValuesCollection is readonly."); } bool ICollection<TValue>.Contains(TValue item) { foreach (TValue value in this ) { if (value.Equals(item)) return true; } return false; } public void CopyTo(TValue[] array, int arrayIndex) { foreach (TValue value in this ) array.SetValue(value, arrayIndex++); } bool ICollection<TValue>.Remove(TValue item) { throw new NotSupportedException("LinkedHashMap ValuesCollection is readonly."); } public int Count { get { return dictionary.Count; } } bool ICollection<TValue>.IsReadOnly { get { return true; } } #endregion #region IEnumerable<TKey> Members IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator() { return new Enumerator(dictionary); } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<TValue> )this ).GetEnumerator(); } #endregion private class Enumerator : ForwardEnumerator<TValue> { public Enumerator(LinkedHashMap<TKey, TValue> dictionary) : base(dictionary) { } public override TValue Current { get { if (dictionary.version != version) throw new InvalidOperationException("Enumerator was modified"); return current.Value; } } } } |
| |||
#endregion private class [[#variable55365ae0]]: ICollection< [[#variable55365a60]]> { private readonly LinkedHashMap<TKey, TValue> dictionary; public [[#variable55365ae0]](LinkedHashMap<TKey, TValue> dictionary) { this.dictionary = dictionary; } #region ICollection<TKey> Members #region ICollection<TValue> Members void ICollection< [[#variable55365a60]]>.Add( [[#variable55365a60]]item) { throw new NotSupportedException( [[#variable553659e0]]); } void ICollection< [[#variable55365a60]]>.Clear() { throw new NotSupportedException( [[#variable553659e0]]); } bool ICollection< [[#variable55365a60]]>.Contains( [[#variable55365a60]]item) { foreach ( [[#variable55365a60]] [[#variable55365980]]in this ) { if ( [[#variable55365980]].Equals(item)) return true; } return false; } public void CopyTo( [[#variable55365a60]][] array, int arrayIndex) { foreach ( [[#variable55365a60]] [[#variable55365980]]in this ) array.SetValue( [[#variable55365980]], arrayIndex++); } bool ICollection< [[#variable55365a60]]>.Remove( [[#variable55365a60]]item) { throw new NotSupportedException( [[#variable553659e0]]); } public int Count { get { return dictionary.Count; } } bool ICollection< [[#variable55365a60]]>.IsReadOnly { get { return true; } } #endregion #region IEnumerable<TKey> Members IEnumerator< [[#variable55365a60]]> IEnumerable< [[#variable55365a60]]>.GetEnumerator() { return new Enumerator(dictionary); } #endregion #region IEnumerable Members IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable< [[#variable55365a60]]> )this ).GetEnumerator(); } #endregion private class Enumerator: ForwardEnumerator< [[#variable55365a60]]> { public Enumerator(LinkedHashMap<TKey, TValue> dictionary): base(dictionary) { } public override [[#variable55365a60]]Current { get { if (dictionary.version != version) throw new InvalidOperationException("Enumerator was modified"); return current. [[#variable55365860]]; } } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#55365ae0]] | KeyCollection |
1 | 2 | [[#55365ae0]] | ValuesCollection |
2 | 1 | [[#55365a60]] | TKey |
2 | 2 | [[#55365a60]] | TValue |
3 | 1 | [[#553659e0]] | "LinkedHashMap KeyCollection is readonly." |
3 | 2 | [[#553659e0]] | "LinkedHashMap ValuesCollection is readonly." |
4 | 1 | [[#55365980]] | key |
4 | 2 | [[#55365980]] | value |
5 | 1 | [[#55365860]] | Key |
5 | 2 | [[#55365860]] | Value |